mirror of https://github.com/mirror/busybox.git
hush: fix expansion of space in "a=${a:+$a }c" construct
function old new delta encode_then_append_var_plusminus 554 552 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>master
parent
8f0e4c42c6
commit
bab8828b0d
|
@ -0,0 +1,2 @@
|
|||
1:'b c'
|
||||
2:'b c'
|
|
@ -0,0 +1,6 @@
|
|||
a=b
|
||||
a=${a:+$a }c
|
||||
echo "1:'$a'"
|
||||
a=b
|
||||
a="${a:+$a }c"
|
||||
echo "2:'$a'"
|
|
@ -6398,7 +6398,7 @@ static NOINLINE int encode_then_append_var_plusminus(o_string *output, int n,
|
|||
if (!dest.o_expflags) {
|
||||
if (ch == EOF)
|
||||
break;
|
||||
if (!dquoted && strchr(G.ifs, ch)) {
|
||||
if (!dquoted && !(output->o_expflags & EXP_FLAG_SINGLEWORD) && strchr(G.ifs, ch)) {
|
||||
/* PREFIX${x:d${e}f ...} and we met space: expand "d${e}f" and start new word.
|
||||
* do not assume we are at the start of the word (PREFIX above).
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
1:'b c'
|
||||
2:'b c'
|
|
@ -0,0 +1,6 @@
|
|||
a=b
|
||||
a=${a:+$a }c
|
||||
echo "1:'$a'"
|
||||
a=b
|
||||
a="${a:+$a }c"
|
||||
echo "2:'$a'"
|
Loading…
Reference in New Issue