about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-08-29 20:27:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-08-29 20:27:47 +0000
commit942009eb9f6451915f23d921c0f49d3102dbd26c (patch)
tree545058d77263ab4e4a40f0665c1925786f777861 /Src/Zle
parentf4f38507e54ad19ea28395f977637bb3f014c9dc (diff)
downloadzsh-942009eb9f6451915f23d921c0f49d3102dbd26c.tar.gz
zsh-942009eb9f6451915f23d921c0f49d3102dbd26c.tar.xz
zsh-942009eb9f6451915f23d921c0f49d3102dbd26c.zip
12719: quoting arrays in vared with real backslashes
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index f02b2b75d..e02ea14b8 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -839,13 +839,16 @@ bin_vared(char *name, char **args, char *ops, int func)
 	    tptr = tmparr = (char **)zhalloc(sizeof(char *)*(arrlen(arr)+1));
 	    for (aptr = arr; *aptr; aptr++) {
 		int sepcount = 0;
-		/* See if this word contains a separator character */
+		/*
+		 * See if this word contains a separator character
+		 * or backslash
+		 */
 		for (t = *aptr; *t; t++) {
 		    if (*t == Meta) {
 			if (isep(t[1] ^ 32))
 			    sepcount++;
 			t++;
-		    } else if (isep(*t))
+		    } else if (isep(*t) || *t == '\\')
 			sepcount++;
 		}
 		if (sepcount) {
@@ -858,7 +861,7 @@ bin_vared(char *name, char **args, char *ops, int func)
 			    if (isep(t[1] ^ 32))
 				*nptr++ = '\\';
 			    *nptr++ = *t++;
-			} else if (isep(*t))
+			} else if (isep(*t) || *t == '\\')
 			    *nptr++ = '\\';
 			*nptr++ = *t++;
 		    }