diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-09-04 06:22:10 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-09-04 06:22:10 +0200 |
commit | b5be13ccd9ce2120468a381a5475955013c0f049 (patch) | |
tree | cf2b99e5a1fc91944dade4c72694f7704502d438 /shell/hush_test | |
parent | 2156e228537065f04e5f862e186421df0db36612 (diff) | |
download | busybox-w32-b5be13ccd9ce2120468a381a5475955013c0f049.tar.gz busybox-w32-b5be13ccd9ce2120468a381a5475955013c0f049.tar.bz2 busybox-w32-b5be13ccd9ce2120468a381a5475955013c0f049.zip |
hush: fix a nommu bug where a part of function body is lost if run in a pipe
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-misc/nommu3.right | 2 | ||||
-rwxr-xr-x | shell/hush_test/hush-misc/nommu3.tests | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/shell/hush_test/hush-misc/nommu3.right b/shell/hush_test/hush-misc/nommu3.right new file mode 100644 index 000000000..da1534bef --- /dev/null +++ b/shell/hush_test/hush-misc/nommu3.right | |||
@@ -0,0 +1,2 @@ | |||
1 | Ok | ||
2 | 0 | ||
diff --git a/shell/hush_test/hush-misc/nommu3.tests b/shell/hush_test/hush-misc/nommu3.tests new file mode 100755 index 000000000..0aca67a67 --- /dev/null +++ b/shell/hush_test/hush-misc/nommu3.tests | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | func() | ||
4 | { | ||
5 | while read p; do echo "$p"; done | ||
6 | } | ||
7 | |||
8 | pipe_to_func() | ||
9 | { | ||
10 | # We had a NOMMU bug which caused "echo Ok |" part ot be lost | ||
11 | echo Ok | func | ||
12 | } | ||
13 | |||
14 | pipe_to_func | cat | ||
15 | echo $? | ||