aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2020-02-16 18:42:50 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2020-02-16 19:22:32 +0100
commit4ace38580927b3b402b6b35ab50893dbfd5f77c3 (patch)
tree4ec3f0fbc314e75c68f63775ebf26d75d8cddce9 /shell/ash.c
parent226b8a143d5632180bef05f728bb497b8318294f (diff)
downloadbusybox-w32-4ace38580927b3b402b6b35ab50893dbfd5f77c3.tar.gz
busybox-w32-4ace38580927b3b402b6b35ab50893dbfd5f77c3.tar.bz2
busybox-w32-4ace38580927b3b402b6b35ab50893dbfd5f77c3.zip
ash: expand: Fix skipping of command substitution when trimming in evalvar
Upstream commit: Date: Mon, 28 May 2018 17:09:48 +0800 expand: Fix skipping of command substitution when trimming in evalvar 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: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 3958db123..97c7f4ef5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7506,6 +7506,8 @@ evalvar(char *p, int flag)
7506 goto record; 7506 goto record;
7507 } 7507 }
7508 7508
7509 varlen = 0;
7510
7509 end: 7511 end:
7510 if (subtype != VSNORMAL) { /* skip to end of alternative */ 7512 if (subtype != VSNORMAL) { /* skip to end of alternative */
7511 int nesting = 1; 7513 int nesting = 1;