diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-07-24 13:03:03 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-07-24 13:03:03 +0200 |
commit | 474cb205554919e4d017b7aeb3722d6a4ffee41d (patch) | |
tree | a6934231956c3f3756b3d78750a83cdddf746b85 /shell/hush_test | |
parent | 3675c37b9b0bb4ba565b690b95b0b9c7d0ce8123 (diff) | |
download | busybox-w32-474cb205554919e4d017b7aeb3722d6a4ffee41d.tar.gz busybox-w32-474cb205554919e4d017b7aeb3722d6a4ffee41d.tar.bz2 busybox-w32-474cb205554919e4d017b7aeb3722d6a4ffee41d.zip |
hush: fix handling of heredocs not enclosed in groups where they are "declared"
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 <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
4 files changed, 20 insertions, 0 deletions
diff --git a/shell/hush_test/hush-heredoc/heredoc_after_compound1.right b/shell/hush_test/hush-heredoc/heredoc_after_compound1.right new file mode 100644 index 000000000..9052f7d1f --- /dev/null +++ b/shell/hush_test/hush-heredoc/heredoc_after_compound1.right | |||
@@ -0,0 +1,2 @@ | |||
1 | Ok1 | ||
2 | Ok2 | ||
diff --git a/shell/hush_test/hush-heredoc/heredoc_after_compound1.tests b/shell/hush_test/hush-heredoc/heredoc_after_compound1.tests new file mode 100755 index 000000000..e7cfb5be1 --- /dev/null +++ b/shell/hush_test/hush-heredoc/heredoc_after_compound1.tests | |||
@@ -0,0 +1,3 @@ | |||
1 | { cat <<EOF; }; echo Ok2 | ||
2 | Ok1 | ||
3 | EOF | ||
diff --git a/shell/hush_test/hush-heredoc/heredoc_var_expand1.right b/shell/hush_test/hush-heredoc/heredoc_var_expand1.right new file mode 100644 index 000000000..eb221832d --- /dev/null +++ b/shell/hush_test/hush-heredoc/heredoc_var_expand1.right | |||
@@ -0,0 +1,4 @@ | |||
1 | |||
2 | Ok1:0 | ||
3 | |||
4 | Ok2:0 | ||
diff --git a/shell/hush_test/hush-heredoc/heredoc_var_expand1.tests b/shell/hush_test/hush-heredoc/heredoc_var_expand1.tests new file mode 100755 index 000000000..3b00bab7b --- /dev/null +++ b/shell/hush_test/hush-heredoc/heredoc_var_expand1.tests | |||
@@ -0,0 +1,11 @@ | |||
1 | x='*' | ||
2 | |||
3 | cat <<- EOF | ||
4 | ${x#'*'} | ||
5 | EOF | ||
6 | echo Ok1:$? | ||
7 | |||
8 | cat <<EOF | ||
9 | ${x#'*'} | ||
10 | EOF | ||
11 | echo Ok2:$? | ||