hush: improve ${var#...}, ${var:+...} and ${var/.../...} - handle quoting
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 17 Jul 2018 12:21:38 +0000 (14:21 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 17 Jul 2018 12:21:38 +0000 (14:21 +0200)
commitb762c784caa78877a9949224af425e52db237beb
treef452b87d4abd8d48bb1c711f9330c786b4c3fe6e
parent1fbb73fc4cee44f0768fbb09fe8f41a52d47ed3e
hush: improve ${var#...}, ${var:+...} and ${var/.../...} - handle quoting

dollar_altvalue1 test partially fails: word splitting of unquoted ${var:+...}
is not correct

function                                             old     new   delta
encode_then_expand_vararg                              -     443    +443
expand_one_var                                      1599    1610     +11
parse_stream                                        2756    2753      -3
encode_string                                        250     242      -8
setup_heredoc                                        308     298     -10
expand_and_evaluate_arith                            106      96     -10
encode_then_expand_string                            142     126     -16
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/5 up/down: 454/-47)           Total: 407 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
19 files changed:
shell/ash_test/ash-quoting/dollar_altvalue1.right [new file with mode: 0644]
shell/ash_test/ash-quoting/dollar_altvalue1.tests [new file with mode: 0755]
shell/ash_test/ash-quoting/dollar_repl_bash1.right [new file with mode: 0644]
shell/ash_test/ash-quoting/dollar_repl_bash1.tests [new file with mode: 0755]
shell/ash_test/ash-quoting/squote_in_varexp.right
shell/ash_test/ash-quoting/squote_in_varexp.tests
shell/ash_test/ash-quoting/squote_in_varexp2.right
shell/ash_test/ash-quoting/squote_in_varexp2.tests
shell/ash_test/ash-z_slow/many_ifs.tests
shell/hush.c
shell/hush_test/hush-quoting/dollar_altvalue1.right [new file with mode: 0644]
shell/hush_test/hush-quoting/dollar_altvalue1.tests [new file with mode: 0755]
shell/hush_test/hush-quoting/dollar_repl_bash1.right [new file with mode: 0644]
shell/hush_test/hush-quoting/dollar_repl_bash1.tests [new file with mode: 0755]
shell/hush_test/hush-quoting/squote_in_varexp.right
shell/hush_test/hush-quoting/squote_in_varexp.tests
shell/hush_test/hush-quoting/squote_in_varexp2.right
shell/hush_test/hush-quoting/squote_in_varexp2.tests
shell/hush_test/hush-z_slow/many_ifs.tests