From c4acfa38ccf3f82226d630c87f687a478fc99b81 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 27 Aug 2017 23:33:50 +0000 Subject: [PATCH] unbreak vi mode '0' movement, bug introduced in r1.323 reported by Larry Hynes --- edit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/edit.c b/edit.c index 383e6c4..8bccf13 100644 --- a/edit.c +++ b/edit.c @@ -28,7 +28,7 @@ #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 @@ -3688,7 +3688,7 @@ vi_hook(int ch) return (1); cmdlen = 0; argc1 = 0; - if (ctype(ch, C_DIGIT)) { + if (ctype(ch, C_DIGIT) && ord(ch) != ord('0')) { argc1 = ksh_numdig(ch); state = VARG1; } else { @@ -3743,7 +3743,7 @@ vi_hook(int ch) case VEXTCMD: argc2 = 0; - if (ctype(ch, C_DIGIT)) { + if (ctype(ch, C_DIGIT) && ord(ch) != ord('0')) { argc2 = ksh_numdig(ch); state = VARG2; return (0);