diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-09-25 22:29:00 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2007-09-25 22:29:00 +0800 |
commit | 7cfd8be0dc83342b4a71f3a8e5b7efab4670e50c (patch) | |
tree | 58bea2cd50124e8599e4ebdbbd2f622138bdc8c2 /src/eval.c | |
parent | [EXPAND] Do not expand tilde in parameter expansion within quotes (diff) | |
download | dash-7cfd8be0dc83342b4a71f3a8e5b7efab4670e50c.tar.gz dash-7cfd8be0dc83342b4a71f3a8e5b7efab4670e50c.zip |
[EXPAND] Move parse-time quote flag detection to run-time
Because the parser does not recursively parse parameter expansion with respect to quotes, we can't accurately determine quote status at parse time. This patch works around this by moving the quote detection to run-time where we do interpret it recursively. Test case: foo=\\ echo "<${foo#[\\]}>" Old result: <\> New result: <>
Diffstat (limited to '')
-rw-r--r-- | src/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index fed82d5..2aa8317 100644 --- a/src/eval.c +++ b/src/eval.c @@ -377,7 +377,7 @@ evalfor(union node *n, int flags) setstackmark(&smark); arglist.lastp = &arglist.list; for (argp = n->nfor.args ; argp ; argp = argp->narg.next) { - expandarg(argp, &arglist, EXP_FULL | EXP_TILDE | EXP_RECORD); + expandarg(argp, &arglist, EXP_FULL | EXP_TILDE); /* XXX */ if (evalskip) goto out; |