summary refs log tree commit diff
path: root/Src
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 /Src
parentadfa6193a20abef25f896358b2c6762991b0175b (diff)
downloadzsh-1add53c578073860f2573fcaaa6fd3f332035238.tar.gz
zsh-1add53c578073860f2573fcaaa6fd3f332035238.tar.xz
zsh-1add53c578073860f2573fcaaa6fd3f332035238.zip
Fix parsing of := for magicequalsubst.
Diffstat (limited to 'Src')
-rw-r--r--Src/subst.c8
1 files changed, 5 insertions, 3 deletions
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);
 	}