[git commit] vi: fix last commit - do terminate the :CMD on the first whitespace

Denys Vlasenko vda.linux at googlemail.com
Sat Feb 7 02:20:26 UTC 2026


commit: https://git.busybox.net/busybox/commit/?id=1380df7a5a877787dcbe100f52dc7d1f978e7f0b
branch: https://git.busybox.net/busybox/log/?h=master

function                                             old     new   delta
colon                                               3942    3952     +10

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 editors/vi.c | 1 +
 1 file changed, 1 insertion(+)

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)
 
 	// get the COMMAND into cmd[]
 	safe_strncpy(cmd, buf, sizeof(cmd));
+	skip_non_whitespace(cmd)[0] = '\0';
 	useforce = last_char_is(cmd, '!');
 	if (useforce && useforce > cmd)
 		*useforce = '\0';   // "CMD!" -> "CMD" (unless single "!")


More information about the busybox-cvs mailing list