<feed xmlns='http://www.w3.org/2005/Atom'>
<title>forks/busybox/shell/ash_test/ash-vars, branch 1_33_stable</title>
<subtitle>Busybox tree with Carbs Linux patches
</subtitle>
<id>https://git.carbslinux.org/forks/busybox/atom?h=1_33_stable</id>
<link rel='self' href='https://git.carbslinux.org/forks/busybox/atom?h=1_33_stable'/>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/'/>
<updated>2020-02-17T09:15:35+00:00</updated>
<entry>
<title>ash: parser: Only accept single-digit parameter expansion outside of braces</title>
<updated>2020-02-17T09:15:35+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2020-02-17T09:15:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=c2ce888030b6b880b3229520a8ff7d7026248a9a'/>
<id>urn:sha1:c2ce888030b6b880b3229520a8ff7d7026248a9a</id>
<content type='text'>
Upstream commit:

    Date: Mon, 27 May 2019 13:39:37 +0800
    parser: Only accept single-digit parameter expansion outside of braces

    This patch should fix the problem.

    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: remove test for "echo ${-}" errorring out - now it works</title>
<updated>2019-05-19T14:35:56+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2019-05-19T14:35:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=30a4c32a4d21728a7e25025f70fcc1d7cd722fe0'/>
<id>urn:sha1:30a4c32a4d21728a7e25025f70fcc1d7cd722fe0</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix quoted "${notexist-}" expansion to not disappear</title>
<updated>2019-05-15T11:39:19+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2019-05-15T11:39:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=9e0adb9b09ec14afe2e5a222dda1c447f336ea06'/>
<id>urn:sha1:9e0adb9b09ec14afe2e5a222dda1c447f336ea06</id>
<content type='text'>
function                                             old     new   delta
expand_one_var                                      2296    2311     +15

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash: expand: Fix ghost fields with unquoted $@/$*</title>
<updated>2018-08-05T12:29:58+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-08-05T12:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=440da97ed79841b55f0b61e4108a336b61642bff'/>
<id>urn:sha1:440da97ed79841b55f0b61e4108a336b61642bff</id>
<content type='text'>
Upstream commit:

    Date: Fri, 23 Mar 2018 18:58:47 +0800
    expand: Fix ghost fields with unquoted $@/$*

    You're right.  The proper fix to this is to ensure that nulonly
    is not set in varvalue for $*.  It should only be set for $@ when
    it's inside double quotes.

    In fact there is another bug while we're playing with $@/$*.
    When IFS is set to a non-whitespace character such as :, $*
    outside quotes won't remove empty fields as it should.

    This patch fixes both problems.

    Reported-by: Martijn Dekker &lt;martijn@inlv.org&gt;
    Suggested-by: Harald van Dijk &lt;harald@gigawatt.nl&gt;
    Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;

function                                             old     new   delta
argstr                                              1111    1113      +2
evalvar                                              571     569      -2
varvalue                                             579     576      -3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 2/-5)               Total: -3 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash: eval: Variable assignments on functions are no longer persistent</title>
<updated>2018-08-05T09:14:11+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-08-05T08:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=9abf53beb48b40e98d50fd35f445d6474af3a494'/>
<id>urn:sha1:9abf53beb48b40e98d50fd35f445d6474af3a494</id>
<content type='text'>
Upstream commit:

    Date: Wed, 4 Apr 2018 17:54:01 +0800
    eval: Variable assignments on functions are no longer persistent

    Dirk Fieldhouse &lt;fieldhouse@gmx.net&gt; wrote:
    &gt; In POSIX.1-2017 ("simultaneously IEEE Std 1003.1™-2017 and The Open
    &gt; Group Technical Standard Base Specifications, Issue 7")
    &gt; &lt;http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09&gt;,
    &gt; we read under '2.9.1 Simple Commands'
    &gt;
    &gt; "Variable assignments shall be performed as follows:
    &gt; ...
    &gt; -    If the command name is a standard utility implemented as a function
    &gt; (see XBD Utility), the effect of variable assignments shall be as if the
    &gt; utility was not implemented as a function.
    &gt; ...
    &gt; -    If the command name is a function that is not a standard utility
    &gt; implemented as a function, variable assignments shall affect the current
    &gt; execution environment during the execution of the function. It is
    &gt; unspecified:
    &gt;
    &gt;     *   Whether or not the variable assignments persist after the
    &gt; completion of the function
    &gt;
    &gt;     *   Whether or not the variables gain the export attribute during
    &gt; the execution of the function
    &gt;
    &gt;     *   Whether or not export attributes gained as a result of the
    &gt; variable assignments persist after the completion of the function (if
    &gt; variable assignments persist after the completion of the function)"

    POSIX used to require the current dash behaviour.  However, you're
    right that this is no longer the case.

    This patch will remove the persistence of the variable assignment.

    I have considered the exporting the variables during the function
    execution but have decided against it because:

    1) It makes the code bigger.
    2) dash has never done this in the past.
    3) You cannot use this portably anyway.

    Reported-by: Dirk Fieldhouse &lt;fieldhouse@gmx.net&gt;
    Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;

function                                             old     new   delta
evalcommand                                         1606    1635     +29
evalcase                                             313     317      +4
evalfun                                              280     268     -12
pushlocalvars                                         48       -     -48
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 2/1 up/down: 33/-60)            Total: -27 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash,hush: properly handle ${v//pattern/repl} if pattern starts with /</title>
<updated>2018-08-04T20:25:28+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-08-04T20:25:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=c2aa218f23a4e952746ebef7bb86668c6255471c'/>
<id>urn:sha1:c2aa218f23a4e952746ebef7bb86668c6255471c</id>
<content type='text'>
Closes 2695

function                                             old     new   delta
parse_dollar                                         762     790     +28
subevalvar                                          1258    1267      +9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 37/0)               Total: 37 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: IFS fixes</title>
<updated>2018-04-11T14:02:58+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-04-11T14:02:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=9678636911b39a7adf9b51d5b625cf4dc7e4ac81'/>
<id>urn:sha1:9678636911b39a7adf9b51d5b625cf4dc7e4ac81</id>
<content type='text'>
$ IFS=": "; x=" "; set x $x; for v; do echo "|$v|"; done
|x|
$ IFS=": "; x=":"; set x $x; for v; do echo "|$v|"; done
|x|
||

function                                             old     new   delta
run_pipe                                            1789    1870     +81
expand_on_ifs                                        310     361     +51
pseudo_exec_argv                                     588     591      +3
builtin_local                                         50      53      +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 138/0)             Total: 138 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash: parser: Allow newlines within parameter substitution</title>
<updated>2018-04-11T10:39:18+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-04-11T10:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=680c3016a2dddc3edb4d79868a728e899638e2c4'/>
<id>urn:sha1:680c3016a2dddc3edb4d79868a728e899638e2c4</id>
<content type='text'>
Upstream commit:

Date: Thu, 22 Mar 2018 21:41:24 +0800
parser: Allow newlines within parameter substitution

    On Fri, Mar 16, 2018 at 11:27:22AM +0800, Herbert Xu wrote:
    &gt; On Thu, Mar 15, 2018 at 10:49:15PM +0100, Harald van Dijk wrote:
    &gt; &gt;
    &gt; &gt; Okay, it can be trivially modified to something that does work in other
    &gt; &gt; shells (even if it were actually executed), but gets rejected at parse time
    &gt; &gt; by dash:
    &gt; &gt;
    &gt; &gt;   if false; then
    &gt; &gt;     : ${$+
    &gt; &gt;   }
    &gt; &gt;   fi
    &gt;
    &gt; That's just a bug in dash's parser with ${} in general, because
    &gt; it bombs out without the if clause too:
    &gt;
    &gt; 	: ${$+
    &gt; 	}

    This patch fixes the parsing of newlines with parameter substitution.

    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>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>shells: fix var_LINENO1.tests false positive, add it to ash tests too</title>
<updated>2018-03-31T18:31:13+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-03-31T18:31:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=32e183e63ecb46595a480ab66120795ed9c9e0df'/>
<id>urn:sha1:32e183e63ecb46595a480ab66120795ed9c9e0df</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
