summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-02-24 21:10:44 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-02-24 21:10:44 +0000
commit29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0 (patch)
tree370166292e493339a53c2641bce35892f7702b12 /Src/Zle
parent230872fa10ed0e9db8d1ca2818ce1a5b8a321928 (diff)
downloadzsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.tar.gz
zsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.tar.xz
zsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.zip
20866: fix deliberate errors in 20861
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_misc.c5
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),
 							&ltmp, NULL);
-		    ZS_mempcy(cmdbuf, ztmp, ltmp);
+		    ZS_memcpy(cmdbuf, ztmp, ltmp);
 		    free(ztmp);
 		    ptr = cmdbuf + cmdambig;
 		    *ptr = ZWC('_');