[git commit] ash: expand: Fix skipping of command substitution when trimming in evalvar

Denys Vlasenko vda.linux at googlemail.com
Sun Feb 16 18:22:32 UTC 2020


commit: https://git.busybox.net/busybox/commit/?id=4ace38580927b3b402b6b35ab50893dbfd5f77c3
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

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 at gondor.apana.org.au>

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash.c | 2 ++
 1 file changed, 2 insertions(+)

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)
 		goto record;
 	}
 
+	varlen = 0;
+
  end:
 	if (subtype != VSNORMAL) {      /* skip to end of alternative */
 		int nesting = 1;


More information about the busybox-cvs mailing list