hush: fix "set -x" output prefix overlapping for v="..`cmd`.." case
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 27 Jul 2018 12:12:05 +0000 (14:12 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 27 Jul 2018 12:12:05 +0000 (14:12 +0200)
commit9dda9270df3108bb85b29c6d382a3477aeb3344b
tree63d8b8bba2d2f42a6c152eb5aa2b6aef5f774dc6
parent186cf4976768029113cf8438734a65bf2c489c5c
hush: fix "set -x" output prefix overlapping for v="..`cmd`.." case

Was printing initial "+" prefix for the assignment, that printing

"+ cmd"

then printing the expanded " v=VAL" string.

Delay printing of "+" prefix for the assignment to after expansion.

function                                             old     new   delta
run_pipe                                            1883    1902     +19
builtin_eval                                         127     133      +6
expand_vars_to_list                                 1103    1106      +3
dump_cmd_in_x_mode                                   144     142      -2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 28/-2)              Total: 26 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/hush.c