about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-03-27 17:55:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-03-27 17:55:41 +0000
commite4059eedc7e825c0711981d4035ab138b1fb21e4 (patch)
tree670f47fc89f98048c11dd68179f57e96ed10338d
parentee52e3c34967e894ce0adf924da12f7962852ce2 (diff)
downloadzsh-e4059eedc7e825c0711981d4035ab138b1fb21e4.tar.gz
zsh-e4059eedc7e825c0711981d4035ab138b1fb21e4.tar.xz
zsh-e4059eedc7e825c0711981d4035ab138b1fb21e4.zip
Mikael: 28941: fix $CURSOR access when metafied
-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;
     }