aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-quoting (follow)
Commit message (Collapse)AuthorAgeFilesLines
* hush: adopt ash's quote_in_varexp1.testsDenys Vlasenko2018-08-052-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix handling of '' in ${var:+ARG}Denys Vlasenko2018-07-203-0/+104
| | | | | | | | | | | | This wasn't an ash bug in dollar_altvalue9, it was hush bug (and bash!) function old new delta expand_one_var 2236 2254 +18 expand_vars_to_list 1097 1103 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 24/0) Total: 24 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix word splitting in ${v:+ARG} - dollar_altvalue1 testDenys Vlasenko2018-07-202-0/+41
| | | | | | | | | | | | | ash might be a bit buggy, need to investigate dollar_altvalue9 test function old new delta expand_one_var 1639 2236 +597 expand_variables 112 128 +16 expand_vars_to_list 1117 1097 -20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 613/-20) Total: 593 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: improve ${var#...}, ${var:+...} and ${var/.../...} - handle quotingDenys Vlasenko2018-07-178-0/+70
| | | | | | | | | | | | | | | | | | 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>
* hush: fix "$v" expansion in case patterns when v='[a]'Denys Vlasenko2018-04-112-0/+9
| | | | | | | | | | | | | | function old new delta run_list 1053 1063 +10 setup_redirects 311 320 +9 encode_then_expand_string 135 142 +7 run_pipe 1784 1789 +5 expand_assignments 81 86 +5 expand_string_to_string 124 125 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/0 up/down: 37/0) Total: 37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a backslash-removal bug in caseDenys Vlasenko2018-04-022-0/+16
| | | | | | | function old new delta run_list 1270 1053 -217 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: parser: Add syntax stack for recursive parsingDenys Vlasenko2018-04-022-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This closes 10821. Upstream patch: From: Herbert Xu <herbert@gondor.apana.org.au> Date: Fri, 9 Mar 2018 00:14:02 +0800 parser: Add syntax stack for recursive parsing Without a stack of syntaxes we cannot correctly these two cases together: "${a#'$$'}" "${a#"${b-'$$'}"}" A recursive parser also helps in some other corner cases such as nested arithmetic expansion with paratheses. This patch adds a syntax stack allocated from the stack using alloca. As a side-effect this allows us to remove the naked backslashes for patterns within double-quotes, which means that EXP_QPAT also has to go. This patch also fixes removes any backslashes that precede right braces when they are present within a parameter expansion context, and backslashes that precede double quotes within inner double quotes inside a parameter expansion in a here-document context. The idea of a recursive parser is based on a patch by Harald van Dijk. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> var_bash3, var_bash4 and var_bash6 tests are updated with the output given by bash-4.3.43 With this patch, the following tests now pass for ash: dollar_repl_slash_bash2.tests squote_in_varexp2.tests squote_in_varexp.tests var_bash4.tests function old new delta readtoken1 2615 2874 +259 synstack_push - 54 +54 evalvar 574 571 -3 rmescapes 330 310 -20 subevalvar 1279 1258 -21 argstr 1146 1107 -39 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/4 up/down: 313/-83) Total: 230 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: new test dollar_repl_slash_bash2.testsDenys Vlasenko2018-03-302-0/+3
| | | | | | This fails for ash. hush works. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a='a\\'; echo "${a%\\\\}"Denys Vlasenko2018-03-024-0/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: tweak bkslash_in_varexp.tests, add bkslash_in_varexp1.testsDenys Vlasenko2018-03-023-1/+22
| | | | | | | | | It turns out bkslash_in_varexp.tests was a bash bug :] ash and hush fail "corrected" bkslash_in_varexp.tests as well, just not as badly as I thought (hush gets half of the cases right). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: two new tests, both fail for ash and hushDenys Vlasenko2018-03-024-0/+22
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash : fix double-quoted "\z" handlingDenys Vlasenko2018-02-132-0/+48
| | | | | | | function old new delta readtoken1 2602 2608 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix quoted_punct.tests failureDenys Vlasenko2017-07-052-0/+76
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix matching of unicode greek letter rho (cf 81) and similar casesDenys Vlasenko2017-07-052-0/+34
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush testsuite: add many tests from ash testsuiteDenys Vlasenko2016-10-022-0/+31
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>