about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-12-08 18:52:04 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-12-08 18:52:04 +0000
commit1cac90759a7c43ab08d4f1582379f6f4a08437d1 (patch)
tree0172986bdee62ed8d32e02e57661e9f040f3be0c /Src/utils.c
parent8c46ae708bf79d02f04f9cfc73afd87b519939f7 (diff)
downloadzsh-1cac90759a7c43ab08d4f1582379f6f4a08437d1.tar.gz
zsh-1cac90759a7c43ab08d4f1582379f6f4a08437d1.tar.xz
zsh-1cac90759a7c43ab08d4f1582379f6f4a08437d1.zip
23036: three more fixes for completion using $'...'
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/Src/utils.c b/Src/utils.c
index de1a219f7..a0f762896 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -4292,9 +4292,17 @@ quotestring(const char *s, char **e, int instring)
 		if (!*u)
 		    u--;
 		continue;
-	    }
-	    else if ((*u == String || *u == Qstring) &&
-		     (u[1] == Inpar || u[1] == Inbrack || u[1] == Inbrace)) {
+	    } else if ((*u == Qstring || *u == '$') && u[1] == '\'' &&
+		       instring == QT_DOUBLE) {
+		/*
+		 * We don't need to quote $'...' inside a double-quoted
+		 * string.  This is largely cosmetic; it looks neater
+		 * if we don't but it doesn't do any harm since the
+		 * \ is stripped.
+		 */
+		*v++ = *u++;
+	    } else if ((*u == String || *u == Qstring) &&
+		       (u[1] == Inpar || u[1] == Inbrack || u[1] == Inbrace)) {
 		char c = (u[1] == Inpar ? Outpar : (u[1] == Inbrace ?
 						    Outbrace : Outbrack));
 		char beg = *u;