about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-15 09:54:46 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-15 09:54:46 +0000
commitdb95186da5a7d0057fa69cfb9393210751ab2cb2 (patch)
tree07d1e4fdf43fe3dd950246f135bcfc109ee8c969 /Src
parent6d4bdb661daf0b677270ba4193fd22a99745851e (diff)
downloadzsh-db95186da5a7d0057fa69cfb9393210751ab2cb2.tar.gz
zsh-db95186da5a7d0057fa69cfb9393210751ab2cb2.tar.xz
zsh-db95186da5a7d0057fa69cfb9393210751ab2cb2.zip
fix for completion of string with single quote (11365)
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 8accf52fb..f516fe211 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -1326,10 +1326,12 @@ get_comp_string(void)
 	autoq = ztrdup(q);
     }
     /* While building the quoted form, we also clean up the command line. */
-    for (p = s, tt = qword, i = wb; *p; p++, tt++, i++)
+    for (p = s, tt = qword, i = wb, j = 0; *p; p++, tt++, i++)
 	if (INULL(*p)) {
 	    if (i < cs)
 		offs--;
+	    if (*p == Snull && isset(RCQUOTES))
+		j = 1-j;
 	    if (p[1] || *p != Bnull) {
 		if (*p == Bnull) {
 		    *tt = '\\';
@@ -1356,7 +1358,8 @@ get_comp_string(void)
 		we--;
 	    }
 	    chuck(p--);
-	}
+	} else if (j && *p == '\'' && i < cs)
+	    offs--;
 
     zsfree(origword);
     origword = ztrdup(s);