aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2026-02-07 03:20:26 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2026-02-07 03:20:26 +0100
commit1380df7a5a877787dcbe100f52dc7d1f978e7f0b (patch)
treee8e3bbffe46062c3de1c21544df60087dd45903f
parent9693daaaef1b996d0efc5338cf3707bb6205fee9 (diff)
downloadbusybox-w32-1380df7a5a877787dcbe100f52dc7d1f978e7f0b.tar.gz
busybox-w32-1380df7a5a877787dcbe100f52dc7d1f978e7f0b.tar.bz2
busybox-w32-1380df7a5a877787dcbe100f52dc7d1f978e7f0b.zip
vi: fix last commit - do terminate the :CMD on the first whitespace
function old new delta colon 3942 3952 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/vi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 3bea8f3e2..757e8eaa0 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2888,6 +2888,7 @@ static void colon(char *buf)
2888 2888
2889 // get the COMMAND into cmd[] 2889 // get the COMMAND into cmd[]
2890 safe_strncpy(cmd, buf, sizeof(cmd)); 2890 safe_strncpy(cmd, buf, sizeof(cmd));
2891 skip_non_whitespace(cmd)[0] = '\0';
2891 useforce = last_char_is(cmd, '!'); 2892 useforce = last_char_is(cmd, '!');
2892 if (useforce && useforce > cmd) 2893 if (useforce && useforce > cmd)
2893 *useforce = '\0'; // "CMD!" -> "CMD" (unless single "!") 2894 *useforce = '\0'; // "CMD!" -> "CMD" (unless single "!")