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>
This commit is contained in:
Denys Vlasenko
2019-05-15 13:39:19 +02:00
parent 8402969d48
commit 9e0adb9b09
5 changed files with 20 additions and 0 deletions

View File

@ -6132,6 +6132,12 @@ static int encode_then_append_var_plusminus(o_string *output, int n,
/* string has no special chars
* && string has no $IFS chars
*/
if (dquoted) {
/* Prints 1 (quoted expansion is a "" word, not nothing):
* set -- "${notexist-}"; echo $#
*/
output->has_quoted_part = 1;
}
return expand_vars_to_list(output, n, str);
}