summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Src/Zle/zle_params.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0dcc5a935..fa51a4af5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-27  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* Mikael: 28941: Src/Zle/zle_params.c: accessing cursor with
+	metafied line was problematic.
+
 2011-03-21  Peter Stephenson  <pws@csr.com>
 
 	* 28936: Src/subst.c: ${#$} and ${#?} also didn't work.
@@ -14367,5 +14372,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5229 $
+* $Revision: 1.5230 $
 *****************************************************
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index 1a23d3c67..3fdb5f8ed 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -230,8 +230,10 @@ get_cursor(UNUSED(Param pm))
 	/* A lot of work for one number, but still... */
 	ZLE_STRING_T tmpline;
 	int tmpcs, tmpll, tmpsz;
-	tmpline = stringaszleline(zlemetaline, zlemetacs,
+	char *tmpmetaline = ztrdup(zlemetaline);
+	tmpline = stringaszleline(tmpmetaline, zlemetacs,
 				  &tmpll, &tmpsz, &tmpcs);
+	free(tmpmetaline);
 	free(tmpline);
 	return tmpcs;
     }