<feed xmlns='http://www.w3.org/2005/Atom'>
<title>forks/busybox/shell/ash_test/ash-heredoc, 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-22T19:29:36+00:00</updated>
<entry>
<title>ash: Expand here-documents in the current shell environment</title>
<updated>2020-02-22T19:29:36+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2020-02-22T19:25:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=c2058ec98cf3f6722be4436cae07a386e3c7b48d'/>
<id>urn:sha1:c2058ec98cf3f6722be4436cae07a386e3c7b48d</id>
<content type='text'>
Upstream commit:

    Date: Sun, 11 Nov 2007 15:27:00 +0800
    Expand here-documents in the current shell environment

    Previously we always expanded here-documents in a subshell.  This is
    contrary to the POSIX specification and how other shells behave.  What's
    more this slows down many expansions due to the extra fork (however, it
    must be said that it is possible for it speed up certain expansions by
    running it simultaneously with the command on two CPUs).

    This patch move the expansion into the current shell environment.

    Test case:

            unset a
            cat &lt;&lt;- EOF &gt; /dev/null
                    ${a=NOT}
            EOF
            echo ${a}BAD

    Old result:

            BAD

    New result:

            NOTBAD

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: add "heredoc.tests" from ash, tweak ash "is a function" message</title>
<updated>2018-07-24T15:10:18+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-24T15:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=63c42afaa43d42def05dfbca1f4e10c7314b1f77'/>
<id>urn:sha1:63c42afaa43d42def05dfbca1f4e10c7314b1f77</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix nested redirects colliding with script fds</title>
<updated>2018-07-24T14:54:41+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-24T14:54:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=41ef41b3e0a16c9f8524870a2dc4f768c237939e'/>
<id>urn:sha1:41ef41b3e0a16c9f8524870a2dc4f768c237939e</id>
<content type='text'>
This necessitates switch from libc FILE api to a simple
homegrown replacement.
The change which fixes the bug here is the deleting of

	restore_redirected_FILEs();

line. It was prematurely moving (restoring) script fd#3.
The fix is: we don't even _want_ to restore scrit fds,
we are perfectly fine with them being moved.
The only reason we tried to restore them is that FILE api
did not allow moving of FILE-&gt;fd.

function                                             old     new   delta
refill_HFILE_and_getc                                  -      93     +93
hfopen                                                 -      90     +90
hfclose                                                -      66     +66
pseudo_exec_argv                                     591     597      +6
hush_main                                           1089    1095      +6
builtin_source                                       209     214      +5
save_fd_on_redirect                                  197     200      +3
setup_redirects                                      320     321      +1
fgetc_interactive                                    235     236      +1
i_peek_and_eat_bkslash_nl                             99      97      -2
expand_vars_to_list                                 1103    1100      -3
restore_redirects                                     99      52     -47
fclose_and_forget                                     57       -     -57
remember_FILE                                         63       -     -63
------------------------------------------------------------------------------
(add/remove: 3/2 grow/shrink: 6/3 up/down: 271/-172)           Total: 99 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: handle backslash-newline in heredoc terminators</title>
<updated>2018-07-24T12:03:18+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-24T12:03:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=dfc739476343244371636d58561f7b743faf50d6'/>
<id>urn:sha1:dfc739476343244371636d58561f7b743faf50d6</id>
<content type='text'>
function                                             old     new   delta
fetch_heredocs                                       479     527     +48

(ash fails this test)

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix handling of heredocs not enclosed in groups where they are "declared"</title>
<updated>2018-07-24T11:03:03+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-24T11:03:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=474cb205554919e4d017b7aeb3722d6a4ffee41d'/>
<id>urn:sha1:474cb205554919e4d017b7aeb3722d6a4ffee41d</id>
<content type='text'>
function                                             old     new   delta
fetch_heredocs                                         -     479    +479
parse_and_run_stream                                 146     148      +2
parse_stream                                        2787    2296    -491
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 481/-491)          Total: -10 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix heredoc handling in the "cmd &lt;&lt;EOF ;&lt;newline&gt;" case</title>
<updated>2018-07-23T14:31:21+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-23T14:31:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=3675c37b9b0bb4ba565b690b95b0b9c7d0ce8123'/>
<id>urn:sha1:3675c37b9b0bb4ba565b690b95b0b9c7d0ce8123</id>
<content type='text'>
function                                             old     new   delta
parse_stream                                        2759    2787     +28

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>hush: fix handling of heredocs starting with empty lines</title>
<updated>2018-07-23T13:43:57+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-07-23T13:43:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=d73cdbf84c9c7d509baf69eb3256dcaf733f4d93'/>
<id>urn:sha1:d73cdbf84c9c7d509baf69eb3256dcaf733f4d93</id>
<content type='text'>
function                                             old     new   delta
parse_stream                                        2748    2759     +11

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash: parser: Fix single-quoted patterns in here-documents</title>
<updated>2018-04-02T11:29:20+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-04-02T11:29:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=c4c2012284c3a3a45843e9400379c84855d853ef'/>
<id>urn:sha1:c4c2012284c3a3a45843e9400379c84855d853ef</id>
<content type='text'>
Upstream commit:

    From: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
    Date: Fri, 9 Mar 2018 23:07:53 +0800
    parser: Fix single-quoted patterns in here-documents

    The script

            x=*
            cat &lt;&lt;- EOF
                    ${x#'*'}
            EOF

    prints * instead of nothing as it should.  The problem is that
    when we're in sqsyntax context in a here-document, we won't add
    CTLESC as we should.  This patch fixes it:

    Reported-by: Harald van Dijk &lt;harald@gigawatt.nl&gt;
    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>parser: Fix backquote support in here-document EOF mark</title>
<updated>2018-04-01T14:38:32+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-04-01T14:38:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=41fddb43729373740bfba82da83373ec5ba49fc8'/>
<id>urn:sha1:41fddb43729373740bfba82da83373ec5ba49fc8</id>
<content type='text'>
Upstream commit:

    Author: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
    Date:   Thu Mar 15 18:27:30 2018 +0800
    parser: Fix backquote support in here-document EOF mark

    Currently using backquotes in a here-document EOF mark is broken
    because dash tries to do command substitution on it.  This patch
    fixes it by checking whether we're looking for an EOF mark during
    tokenisation.

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

With added fix for quoted-ness of the EOF mark.

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash: use pgetc_eatbnl() in more places</title>
<updated>2018-03-31T17:40:56+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-03-31T17:21:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.carbslinux.org/forks/busybox/commit/?id=220be537a03f029e1e619003d6f7def10103a156'/>
<id>urn:sha1:220be537a03f029e1e619003d6f7def10103a156</id>
<content type='text'>
Part of upstream commit:

    Date:   Thu Mar 8 08:37:11 2018 +0100
    Author: Harald van Dijk &lt;harald@gigawatt.nl&gt;
    parser: use pgetc_eatbnl() in more places

    dash has a pgetc_eatbnl function in parser.c which skips any
    backslash-newline combinations. It's not used everywhere it could be.
    There is also some duplicated backslash-newline handling elsewhere in
    parser.c. Replace most of the calls to pgetc() with calls to
    pgetc_eatbnl() and remove the duplicated backslash-newline handling.

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

Not adding "readtoken1(pgetc_eatbnl(), DQSYNTAX..." changes, since
readtoken1() handles the "starts with backslash + newline" case itself.

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
