summary refs log tree commit diff
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
parent230872fa10ed0e9db8d1ca2818ce1a5b8a321928 (diff)
downloadzsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.tar.gz
zsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.tar.xz
zsh-29b6b82ade1a38df6a3227ba45f4eafc0b5d6fe0.zip
20866: fix deliberate errors in 20861
-rw-r--r--ChangeLog4
-rw-r--r--Src/Zle/zle_misc.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f2706dd6..e2683d627 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-24  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
+
+	* 20866: Src/Zle/zle_misc.c: two mistakes in 20861.
+
 2005-02-24  Oliver Kiddle  <opk@zsh.org>
 
 	* Konstantin Sobolev: 20832 (modified):
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('_');