expand: Fix skipping of command substitution when trimming in evalvar

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>

diff --git a/src/expand.c b/src/expand.c
index a8bc142..f9ab160 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -810,6 +810,8 @@ record:
 		goto record;
 	}
 
+	varlen = 0;
+
 end:
 	if (subtype != VSNORMAL) {	/* skip to end of alternative */
 		int nesting = 1;
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux