diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2018-05-28 17:09:48 +0800 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-03-28 21:42:55 +0000 |
commit | 603b0dd1f1e08e9184661251513d281c89a42fac (patch) | |
tree | 869a5518c0e18badb6801ab192b6e4eff24cb75c | |
parent | 2f87fa05fd311442068969ce3880961d1e4a98b1 (diff) | |
download | klibc-603b0dd1f1e08e9184661251513d281c89a42fac.tar.gz |
[klibc] dash: expand: Fix skipping of command substitution when trimming in evalvar
[ dash commit c5819fdd6e587aeb0bceaf60e86999a484541a19 ]
When we are trimming an unset variable in evalvar, any embedded
command substitution that should have been skipped are not. This
can cause them to be evaluated later should there be other command
substitutions in the same input word.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | usr/dash/expand.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr/dash/expand.c b/usr/dash/expand.c index a764881eeb85f..df2266326007c 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -805,6 +805,8 @@ record: goto record; } + varlen = 0; + end: if (subtype != VSNORMAL) { /* skip to end of alternative */ int nesting = 1; |