about summary refs log tree commit diff
diff options
context:
space:
mode:
-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('_');