about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2013-08-08 20:10:06 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2013-08-08 20:10:06 +0100
commit8ae8fae4001873515c2465ca05b8ac77a35a72e5 (patch)
tree376c0f5fa113b9c9a0191319e10c8e309ddaa5e2 /Src
parent0b185e3dcd7348045787b972a80d62da4ca0c79f (diff)
downloadzsh-8ae8fae4001873515c2465ca05b8ac77a35a72e5.tar.gz
zsh-8ae8fae4001873515c2465ca05b8ac77a35a72e5.tar.xz
zsh-8ae8fae4001873515c2465ca05b8ac77a35a72e5.zip
31644: Fix insertion of multibyte characters into editor line.
This was broken for a string that came from outside ZLE in the case
where the editing buffer wasn't metafied, i.e. not in completion.
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 610055c64..e30e0b1aa 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2136,8 +2136,8 @@ inststrlen(char *str, int move, int len)
 	return 0;
     if (len == -1)
 	len = strlen(str);
-    spaceinline(len);
     if (zlemetaline != NULL) {
+	spaceinline(len);
 	strncpy(zlemetaline + zlemetacs, str, len);
 	if (move)
 	    zlemetacs += len;
@@ -2148,6 +2148,7 @@ inststrlen(char *str, int move, int len)
 
 	instr = ztrduppfx(str, len);
 	zlestr = stringaszleline(instr, 0, &zlelen, NULL, NULL);
+	spaceinline(zlelen);
 	ZS_strncpy(zleline + zlecs, zlestr, zlelen);
 	free(zlestr);
 	zsfree(instr);