diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2005-02-24 21:10:44 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2005-02-24 21:10:44 +0000 |
commit | 29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0 (patch) | |
tree | 370166292e493339a53c2641bce35892f7702b12 /Src/Zle/zle_misc.c | |
parent | 230872fa10ed0e9db8d1ca2818ce1a5b8a321928 (diff) | |
download | zsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.tar.gz zsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.tar.xz zsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.zip |
20866: fix deliberate errors in 20861
Diffstat (limited to 'Src/Zle/zle_misc.c')
-rw-r--r-- | Src/Zle/zle_misc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index e9082255f..270a4030a 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -775,10 +775,13 @@ executenamedcommand(char *prmt) char *okeymap = ztrdup(curkeymapname); clearlist = 1; + /* prmt may be constant */ + prmt = ztrdup(prmt); zprmt = stringaszleline((unsigned char *)prmt, &l, NULL); cmdbuf = zhalloc((l + NAMLEN + 2) * ZLE_CHAR_SIZE); ZS_memcpy(cmdbuf, zprmt, l); free(zprmt); + zsfree(prmt); statusline = cmdbuf; selectkeymap("main", 1); ptr = cmdbuf += l; @@ -919,7 +922,7 @@ executenamedcommand(char *prmt) int ltmp; ZLE_STRING_T ztmp = stringaszleline(peekfirst(cmdll), <mp, NULL); - ZS_mempcy(cmdbuf, ztmp, ltmp); + ZS_memcpy(cmdbuf, ztmp, ltmp); free(ztmp); ptr = cmdbuf + cmdambig; *ptr = ZWC('_'); |