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-03-31 00:48:18 +0200
commit6ffaa00338a9dc5f9e798c30aa9f96e51ab2ef36 (patch)
tree2d4a0bb86f76fba8e8f1eedfa4e59d8c28b2592e
parent73523079a2c5f1cf370095a3166bace1d01fcba5 (diff)
downloadbusybox-w32-6ffaa00338a9dc5f9e798c30aa9f96e51ab2ef36.tar.gz
busybox-w32-6ffaa00338a9dc5f9e798c30aa9f96e51ab2ef36.tar.bz2
busybox-w32-6ffaa00338a9dc5f9e798c30aa9f96e51ab2ef36.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 e6dd1bc3d..01d8f5935 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -6126,7 +6126,7 @@ static NOINLINE int expand_vars_to_list(o_string *output, int n, char *arg)
6126 } else 6126 } else
6127 /* If EXP_FLAG_SINGLEWORD, we handle assignment 'a=....$@.....' 6127 /* If EXP_FLAG_SINGLEWORD, we handle assignment 'a=....$@.....'
6128 * and in this case should treat it like '$*' - see 'else...' below */ 6128 * and in this case should treat it like '$*' - see 'else...' below */
6129 if (first_ch == ('@'|0x80) /* quoted $@ */ 6129 if (first_ch == (char)('@'|0x80) /* quoted $@ */
6130 && !(output->o_expflags & EXP_FLAG_SINGLEWORD) /* not v="$@" case */ 6130 && !(output->o_expflags & EXP_FLAG_SINGLEWORD) /* not v="$@" case */
6131 ) { 6131 ) {
6132 while (1) { 6132 while (1) {