diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-05-15 13:39:19 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-05-15 13:39:19 +0200 |
commit | 9e0adb9b09ec14afe2e5a222dda1c447f336ea06 (patch) | |
tree | 49ba7977aab90ee21b90f30cd49d68a1bb715585 /shell/hush.c | |
parent | 8402969d4892891ddfde524fbb9ee73e076f3771 (diff) | |
download | busybox-w32-9e0adb9b09ec14afe2e5a222dda1c447f336ea06.tar.gz busybox-w32-9e0adb9b09ec14afe2e5a222dda1c447f336ea06.tar.bz2 busybox-w32-9e0adb9b09ec14afe2e5a222dda1c447f336ea06.zip |
hush: fix quoted "${notexist-}" expansion to not disappear
function old new delta
expand_one_var 2296 2311 +15
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c index b612c80da..a103e8169 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -6132,6 +6132,12 @@ static int encode_then_append_var_plusminus(o_string *output, int n, | |||
6132 | /* string has no special chars | 6132 | /* string has no special chars |
6133 | * && string has no $IFS chars | 6133 | * && string has no $IFS chars |
6134 | */ | 6134 | */ |
6135 | if (dquoted) { | ||
6136 | /* Prints 1 (quoted expansion is a "" word, not nothing): | ||
6137 | * set -- "${notexist-}"; echo $# | ||
6138 | */ | ||
6139 | output->has_quoted_part = 1; | ||
6140 | } | ||
6135 | return expand_vars_to_list(output, n, str); | 6141 | return expand_vars_to_list(output, n, str); |
6136 | } | 6142 | } |
6137 | 6143 | ||