<feed xmlns='http://www.w3.org/2005/Atom'>
<title>forks/busybox/shell/ash_test/ash-quoting, branch master</title>
<subtitle>Busybox tree with Carbs Linux patches
</subtitle>
<id>https://git.carbslinux.org/forks/busybox/atom?h=master</id>
<link rel='self' href='https://git.carbslinux.org/forks/busybox/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/'/>
<updated>2020-02-21T15:30:44+00:00</updated>
<entry>
<title>ash: expand: Ensure result is escaped in cvtnum</title>
<updated>2020-02-21T15:30:44+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2020-02-21T15:30:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=45dd87aac05ddf8bbfb110fde85ef875f3adfb65'/>
<id>urn:sha1:45dd87aac05ddf8bbfb110fde85ef875f3adfb65</id>
<content type='text'>
Upstream commit:

    Date: Fri, 1 Jun 2018 18:25:29 +0800
    expand: Ensure result is escaped in cvtnum

    The minus sign generated from arithmetic expansion is currently
    unquoted which causes anomalies when the result is used in where
    the quoting matters.

    This patch fixes it by explicitly calling memtodest on the result
    in cvtnum.

    Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix handling of '' in ${var:+ARG}</title>
<updated>2018-07-20T15:36:06+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-20T15:36:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=83e434d5b56baccf617ebcc8a752959f7c4aacfc'/>
<id>urn:sha1:83e434d5b56baccf617ebcc8a752959f7c4aacfc</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix word splitting in ${v:+ARG} - dollar_altvalue1 test</title>
<updated>2018-07-20T14:29:43+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-20T14:18:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=294eb4612cd668521faa48711297196f00af61d9'/>
<id>urn:sha1:294eb4612cd668521faa48711297196f00af61d9</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: improve ${var#...}, ${var:+...} and ${var/.../...} - handle quoting</title>
<updated>2018-07-17T12:21:38+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-17T12:21:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=b762c784caa78877a9949224af425e52db237beb'/>
<id>urn:sha1:b762c784caa78877a9949224af425e52db237beb</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix "$v" expansion in case patterns when v='[a]'</title>
<updated>2018-04-11T11:47:59+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-04-11T11:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=34179956f96370f5a53e73073d984d62135cd037'/>
<id>urn:sha1:34179956f96370f5a53e73073d984d62135cd037</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash: parser: Fix parameter expansion inside inner double quotes</title>
<updated>2018-04-02T19:00:59+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-04-02T19:00:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=f50e14632f7be56da7a38937c887f77812803f70'/>
<id>urn:sha1:f50e14632f7be56da7a38937c887f77812803f70</id>
<content type='text'>
Upstream email:

    parser: Fix parameter expansion inside inner double quotes

    The parsing of parameter expansion inside inner double quotes
    breaks because we never look for ENDVAR while innerdq is true.

            echo "${x#"${x+''}"''}

    This patch fixes it by pushing the syntax stack if innerdq is
    true and we enter a new parameter expansion.

    This patch also fixes a corner case where a bad substitution error
    occurs within arithmetic expansion.

    Reported-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
    Fixes: ab1cecb40478 (" parser: Add syntax stack for recursive...")
    Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;

function                                             old     new   delta
readtoken1                                          2880    2898     +18

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix a backslash-removal bug in case</title>
<updated>2018-04-02T15:25:18+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-04-02T15:25:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=abf755615e5f20c3bbe7534fa29c72fd684ea616'/>
<id>urn:sha1:abf755615e5f20c3bbe7534fa29c72fd684ea616</id>
<content type='text'>
function                                             old     new   delta
run_list                                            1270    1053    -217

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash: parser: Add syntax stack for recursive parsing</title>
<updated>2018-04-02T11:15:37+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-04-02T10:35:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=216913c290fd2b88b744c04c0a2ef21fd1410ba9'/>
<id>urn:sha1:216913c290fd2b88b744c04c0a2ef21fd1410ba9</id>
<content type='text'>
This closes 10821.

Upstream patch:

    From: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
    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 &lt;herbert@gondor.apana.org.au&gt;

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 &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash,hush: new test dollar_repl_slash_bash2.tests</title>
<updated>2018-03-30T21:25:24+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-03-30T21:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=73523079a2c5f1cf370095a3166bace1d01fcba5'/>
<id>urn:sha1:73523079a2c5f1cf370095a3166bace1d01fcba5</id>
<content type='text'>
This fails for ash. hush works.

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix a='a\\'; echo "${a%\\\\}"</title>
<updated>2018-03-02T19:48:36+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-03-02T19:48:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=d4802c6243e64e28690577bc0bb4f030581c496b'/>
<id>urn:sha1:d4802c6243e64e28690577bc0bb4f030581c496b</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
