From: Denys Vlasenko Date: Thu, 15 Sep 2016 11:53:42 +0000 (+0200) Subject: vi: make "g" error message less likely to show garbage X-Git-Tag: 1_26_0~267 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=de1996dac516a49cd4c86270b918721f6e9f3f5d;p=oweals%2Fbusybox.git vi: make "g" error message less likely to show garbage Signed-off-by: Denys Vlasenko --- diff --git a/editors/vi.c b/editors/vi.c index 974f9978b..c142dacd7 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -3933,7 +3933,9 @@ static void do_cmd(int c) c1 = get_one_char(); if (c1 != 'g') { buf[0] = 'g'; - buf[1] = c1; // TODO: if Unicode? + // c1 < 0 if the key was special. Try "g" + // TODO: if Unicode? + buf[1] = (c1 >= 0 ? c1 : '*'); buf[2] = '\0'; not_implemented(buf); break;