about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/subst.c2
-rw-r--r--Test/D03procsubst.ztst4
3 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ba6f1159..b48d6a40c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-26  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 46110: Src/subst.c, Test/D03procsubst.ztst: If =subst occurs
+	before =(subst) we should allow for the possibility of the latter.
+
 2020-06-26  Oliver Kiddle  <okiddle@yahoo.co.uk>
 
 	* unposted c.f. 46034: Completion/Unix/Command/_gpg: workaround
diff --git a/Src/subst.c b/Src/subst.c
index 90b5fc121..ed3f4a82b 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -796,7 +796,7 @@ filesubstr(char **namptr, int assign)
 	    *namptr = dyncat(hom, ptr);
 	    return 1;
 	}
-    } else if (*str == Equals && isset(EQUALS) && str[1]) {   /* =foo */
+    } else if (*str == Equals && isset(EQUALS) && str[1] && str[1] != Inpar) {   /* =foo */
 	char *expn = equalsubstr(str+1, assign, isset(NOMATCH));
 	if (expn) {
 	    *namptr = expn;
diff --git a/Test/D03procsubst.ztst b/Test/D03procsubst.ztst
index 8cf4e2a7f..68a68ef6e 100644
--- a/Test/D03procsubst.ztst
+++ b/Test/D03procsubst.ztst
@@ -156,3 +156,7 @@
   procfunc <(echo argument)
 0:With /proc/self file descriptors must not be tidied up too early
 >argument
+
+  $ZTST_testdir/../Src/zsh -df -o shfileexpansion -c 'cat =(echo hi)'
+0:EQUALS expansion followed by =(...) (sh ordering) should work
+>hi