about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-04-09 15:40:13 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-04-09 15:40:13 +0000
commite2d855f3644064cd4e17b84d08f03a5740b5bae5 (patch)
tree3fe49b40967850721afdd8a350b43db073a6a4b0
parent27c1ca8628b03943768c8d9ebfdac1a46ec41374 (diff)
downloadzsh-e2d855f3644064cd4e17b84d08f03a5740b5bae5.tar.gz
zsh-e2d855f3644064cd4e17b84d08f03a5740b5bae5.tar.xz
zsh-e2d855f3644064cd4e17b84d08f03a5740b5bae5.zip
27865: fix problem with glob_subst in parameter subsitution
-rw-r--r--ChangeLog7
-rw-r--r--Src/subst.c2
-rw-r--r--Test/D04parameter.ztst10
3 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ff123b5d4..fb30dfd98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-04-09  Peter Stephenson  <pws@csr.com>
 
+	* 27865: Src/subst.c, Test/D04parameter.ztst: text in parameter
+	substitution that came from the command line rather than the
+	parameter was a candidate for GLOB_SUBST even if it was quoted
+	if the overall expression was not quoted.
+
 	* Ben: 27589: Completion/Zsh/Context/_redirect: attempt
 	to use arguments better.
 
@@ -12988,5 +12993,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4949 $
+* $Revision: 1.4950 $
 *****************************************************
diff --git a/Src/subst.c b/Src/subst.c
index 52288b741..6da9bfed8 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2417,7 +2417,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 		multsub(&val, spbreak && !aspar, (aspar ? NULL : &aval), &isarr, NULL);
 		opts[SHWORDSPLIT] = ws;
 		copied = 1;
-		spbreak = 0;
+		spbreak = globsubst = 0;
 	    }
 	    break;
 	case ':':
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index d43e60efa..1035fd49b 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -221,6 +221,16 @@
 >\\foo matched by \\*\\
 >a\\b not matched by \\*\\
 
+  (
+    setopt globsubst
+    foo="boring*"
+    print ${foo+$foo}
+    print ${foo+"$foo"}
+  )
+0:globsubst together with nested quoted expansion
+>boringfile
+>boring*
+
   print -l "${$(print one word)}" "${=$(print two words)}"
 0:splitting of $(...) inside ${...}
 >one word