From: Denys Vlasenko Date: Fri, 30 Mar 2018 22:46:07 +0000 (+0200) Subject: hush: fix a signedness bug X-Git-Tag: 1_28_3~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e04a38c0c91c17ce27fb11d83f6767614b7d6b59;p=oweals%2Fbusybox.git hush: fix a signedness bug Testcase: set -- a ""; space=" "; printf "<%s>\n" "$@"$space Before: After: <> It usually does not bite since bbox forces -funsigned-char build. Signed-off-by: Denys Vlasenko --- 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) } else /* If EXP_FLAG_SINGLEWORD, we handle assignment 'a=....$@.....' * and in this case should treat it like '$*' - see 'else...' below */ - if (first_ch == ('@'|0x80) /* quoted $@ */ + if (first_ch == (char)('@'|0x80) /* quoted $@ */ && !(output->o_expflags & EXP_FLAG_SINGLEWORD) /* not v="$@" case */ ) { while (1) {