Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: Minor expansion problem
- X-seq: zsh-workers 15871
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: PATCH: Re: Minor expansion problem
- Date: Tue, 25 Sep 2001 16:39:45 +0000
- In-reply-to: <8328.1001434108@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <8328.1001434108@xxxxxxx>
On Sep 25, 5:08pm, Peter Stephenson wrote:
}
} Bart Schaefer wrote:
} > Expanding $(...) doesn't put
} > in backslashes, but expanding `...` does. This appears to be happening
} > because the ${(e)exp} at _expand line 83 returns one word for `...` but
} > an array for $(...).
}
} Yes, it's completely reproducible just with ${(e)exp}.
This seems to fix it (and a typo in a comment). I'm a bit dubious of
changing mult_isarr possibly in the middle of a word, but that's what
happens in the $(...) case at line 111, so ...
Index: Src/subst.c
===================================================================
diff -c -r1.6 subst.c
--- Src/subst.c 2001/09/05 15:22:33 1.6
+++ Src/subst.c 2001/09/25 16:33:20
@@ -133,7 +133,7 @@
str3 = (char *)getdata(node);
continue;
}
- } else if ((qt = c == Qtick) || c == Tick)
+ } else if ((qt = c == Qtick) || (c == Tick ? mult_isarr = 1 : 0))
comsub: {
LinkList pl;
char *s, *str2 = str;
@@ -1492,7 +1492,7 @@
/* This once was executed only `if (qt) ...'. But with that
* patterns in a expansion resulting from a ${(e)...} aren't
* tokenized even though this function thinks they are (it thinks
- * they are because subst_parse_string() turns Qstring tokens
+ * they are because subst_parse_str() turns Qstring tokens
* into String tokens and for unquoted parameter expansions the
* lexer normally does tokenize patterns inside parameter
* expansions). */
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author