unbreak vi mode '0' movement, bug introduced in r1.323

reported by Larry Hynes <larry@larryhynes.com>
This commit is contained in:
tg 2017-08-27 23:33:50 +00:00
parent 3a4eaf6f59
commit c4acfa38cc
1 changed files with 3 additions and 3 deletions

6
edit.c
View File

@ -28,7 +28,7 @@
#ifndef MKSH_NO_CMDLINE_EDITING #ifndef MKSH_NO_CMDLINE_EDITING
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.339 2017/08/08 00:03:56 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/edit.c,v 1.340 2017/08/27 23:33:50 tg Exp $");
/* /*
* in later versions we might use libtermcap for this, but since external * in later versions we might use libtermcap for this, but since external
@ -3688,7 +3688,7 @@ vi_hook(int ch)
return (1); return (1);
cmdlen = 0; cmdlen = 0;
argc1 = 0; argc1 = 0;
if (ctype(ch, C_DIGIT)) { if (ctype(ch, C_DIGIT) && ord(ch) != ord('0')) {
argc1 = ksh_numdig(ch); argc1 = ksh_numdig(ch);
state = VARG1; state = VARG1;
} else { } else {
@ -3743,7 +3743,7 @@ vi_hook(int ch)
case VEXTCMD: case VEXTCMD:
argc2 = 0; argc2 = 0;
if (ctype(ch, C_DIGIT)) { if (ctype(ch, C_DIGIT) && ord(ch) != ord('0')) {
argc2 = ksh_numdig(ch); argc2 = ksh_numdig(ch);
state = VARG2; state = VARG2;
return (0); return (0);