about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2000-06-17 19:51:51 +0000
committerBart Schaefer <barts@users.sourceforge.net>2000-06-17 19:51:51 +0000
commit1add53c578073860f2573fcaaa6fd3f332035238 (patch)
treeba1a97e31436aa33c7a827ac1b9eac87c158ac0f
parentadfa6193a20abef25f896358b2c6762991b0175b (diff)
downloadzsh-1add53c578073860f2573fcaaa6fd3f332035238.tar.gz
zsh-1add53c578073860f2573fcaaa6fd3f332035238.tar.xz
zsh-1add53c578073860f2573fcaaa6fd3f332035238.zip
Fix parsing of := for magicequalsubst.
-rw-r--r--ChangeLog5
-rw-r--r--Src/subst.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f5b2419f3..9ede30b07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-17  Bart Schaefer  <schaefer@zsh.org>
+
+	* 11961: Src/subst.c: 11959 was really a bug in magicequalsubst,
+	it shouldn't have treated x:=y as a reason to expand =y.
+
 2000-06-17  Tanaka Akira  <akr@zsh.org>
 
 	* 11959: Completion/User/_urls: make it magicequalsubst aware.
diff --git a/Src/subst.c b/Src/subst.c
index 5dad163ee..0cb985d71 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -307,7 +307,7 @@ multsub(char **s, char ***a, int *isarr, char *sep)
 mod_export void
 filesub(char **namptr, int assign)
 {
-    char *sub = NULL, *str, *ptr;
+    char *eql = NULL, *sub = NULL, *str, *ptr;
     int len;
 
     filesubstr(namptr, assign);
@@ -316,7 +316,7 @@ filesub(char **namptr, int assign)
 	return;
 
     if (assign & PF_TYPESET) {
-	if ((*namptr)[1] && (sub = strchr(*namptr + 1, Equals))) {
+	if ((*namptr)[1] && (eql = sub = strchr(*namptr + 1, Equals))) {
 	    str = sub + 1;
 	    if ((sub[1] == Tilde || sub[1] == Equals) && filesubstr(&str, assign)) {
 		sub[1] = '\0';
@@ -330,7 +330,9 @@ filesub(char **namptr, int assign)
     while ((sub = strchr(ptr, ':'))) {
 	str = sub + 1;
 	len = sub - *namptr;
-	if ((sub[1] == Tilde || sub[1] == Equals) && filesubstr(&str, assign)) {
+	if (sub > eql &&
+	    (sub[1] == Tilde || sub[1] == Equals) &&
+	    filesubstr(&str, assign)) {
 	    sub[1] = '\0';
 	    *namptr = dyncat(*namptr, str);
 	}