aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-03-31 00:46:07 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-04-01 13:04:11 +0200
commite04a38c0c91c17ce27fb11d83f6767614b7d6b59 (patch)
treefe0dae49077e82b1c34b44894854b23207b69d34
parent78ee8fc3e457452a6cdd25802b85f45b064bb845 (diff)
downloadbusybox-w32-e04a38c0c91c17ce27fb11d83f6767614b7d6b59.tar.gz
busybox-w32-e04a38c0c91c17ce27fb11d83f6767614b7d6b59.tar.bz2
busybox-w32-e04a38c0c91c17ce27fb11d83f6767614b7d6b59.zip
hush: fix a signedness bug
Testcase: set -- a ""; space=" "; printf "<%s>\n" "$@"$space Before: <a > After: <a> <> It usually does not bite since bbox forces -funsigned-char build. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index b76b8fda4..e69903d10 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -6015,7 +6015,7 @@ static NOINLINE int expand_vars_to_list(o_string *output, int n, char *arg)
6015 } else 6015 } else
6016 /* If EXP_FLAG_SINGLEWORD, we handle assignment 'a=....$@.....' 6016 /* If EXP_FLAG_SINGLEWORD, we handle assignment 'a=....$@.....'
6017 * and in this case should treat it like '$*' - see 'else...' below */ 6017 * and in this case should treat it like '$*' - see 'else...' below */
6018 if (first_ch == ('@'|0x80) /* quoted $@ */ 6018 if (first_ch == (char)('@'|0x80) /* quoted $@ */
6019 && !(output->o_expflags & EXP_FLAG_SINGLEWORD) /* not v="$@" case */ 6019 && !(output->o_expflags & EXP_FLAG_SINGLEWORD) /* not v="$@" case */
6020 ) { 6020 ) {
6021 while (1) { 6021 while (1) {