diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Src/subst.c | 15 |
2 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 851c7ba0c..7e711ac70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-05-18 Sven Wischnowsky <wischnow@zsh.org> + + * 14381: Src/subst.c: try to make ${(e)..} work for complicated + parameter expansions in the value; this means: keep Qstring + tokens unchanged if they are inside double quotes and + tokenizing patterns in parameter expansions + 2001-05-18 Bart Schaefer <schaefer@zsh.org> * unposted: Test/.distfiles, Test/V01zmodload.ztst: Add the basic diff --git a/Src/subst.c b/Src/subst.c index 492778400..24103b3da 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -720,9 +720,13 @@ subst_parse_str(char **sp, int single, int err) if (!(err ? parsestr(s) : parsestrnoerr(s))) { if (!single) { + int qt = 0; + for (; *s; s++) - if (*s == Qstring) + if (!qt && *s == Qstring) *s = String; + else if (*s == Dnull) + qt = !qt; } return 0; } @@ -1483,7 +1487,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) case '#': case Pound: case '/': - if (qt) { + /* 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 + * into String tokens and for unquoted parameter expansions the + * lexer normally does tokenize patterns inside parameter + * expansions). */ + { int one = noerrs, oef = errflag, haserr; if (!quoteerr) |