summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-11-02 21:33:34 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-11-03 09:12:10 -0700
commit696444714e9670f1f725381abde2cd8cb20d59dd (patch)
tree5cd76d4ecc387594d2044a20f4790037892efd15 /Src
parentd90775fc29425934895b0222aa4092f12e9bcd1c (diff)
downloadzsh-696444714e9670f1f725381abde2cd8cb20d59dd.tar.gz
zsh-696444714e9670f1f725381abde2cd8cb20d59dd.tar.xz
zsh-696444714e9670f1f725381abde2cd8cb20d59dd.zip
39813: fix keybuflen after ungetting extra keys from the end of keybuf in getkeymapcmd().
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_keymap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 3db4207d9..34c9c686e 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -135,7 +135,10 @@ mod_export HashTable keymapnamtab;
 /**/
 char *keybuf;
 
-static int keybuflen, keybufsz = 20;
+/**/
+int keybuflen;
+
+static int keybufsz = 20;
 
 /* last command executed with execute-named-command */
 
@@ -1622,7 +1625,7 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp)
 	ungetbytes(keybuf+lastlen, keybuflen);
 	if(vichgflag)
 	    vichgbufptr -= keybuflen;
-	keybuf[lastlen] = 0;
+	keybuf[keybuflen = lastlen] = 0;
     }
     *funcp = func;
     *strp = str;