summaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko2015-09-04 06:22:10 +0200
committerDenys Vlasenko2015-09-04 06:22:10 +0200
commitb5be13ccd9ce2120468a381a5475955013c0f049 (patch)
treecf2b99e5a1fc91944dade4c72694f7704502d438 /shell/hush_test
parent2156e228537065f04e5f862e186421df0db36612 (diff)
downloadbusybox-b5be13ccd9ce2120468a381a5475955013c0f049.zip
busybox-b5be13ccd9ce2120468a381a5475955013c0f049.tar.gz
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.right2
-rwxr-xr-xshell/hush_test/hush-misc/nommu3.tests15
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 0000000..da1534b
--- /dev/null
+++ b/shell/hush_test/hush-misc/nommu3.right
@@ -0,0 +1,2 @@
+Ok
+0
diff --git a/shell/hush_test/hush-misc/nommu3.tests b/shell/hush_test/hush-misc/nommu3.tests
new file mode 100755
index 0000000..0aca67a
--- /dev/null
+++ b/shell/hush_test/hush-misc/nommu3.tests
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+func()
+{
+ while read p; do echo "$p"; done
+}
+
+pipe_to_func()
+{
+ # We had a NOMMU bug which caused "echo Ok |" part ot be lost
+ echo Ok | func
+}
+
+pipe_to_func | cat
+echo $?