From c5819fdd6e587aeb0bceaf60e86999a484541a19 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 28 May 2018 17:09:48 +0800 Subject: 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 --- src/expand.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/expand.c b/src/expand.c index c565646..7a51766 100644 --- a/src/expand.c +++ b/src/expand.c @@ -805,6 +805,8 @@ record: goto record; } + varlen = 0; + end: if (subtype != VSNORMAL) { /* skip to end of alternative */ int nesting = 1; -- cgit 1.4.1