From b5be13ccd9ce2120468a381a5475955013c0f049 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 4 Sep 2015 06:22:10 +0200 Subject: hush: fix a nommu bug where a part of function body is lost if run in a pipe Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-misc/nommu3.right | 2 ++ shell/hush_test/hush-misc/nommu3.tests | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 shell/hush_test/hush-misc/nommu3.right create mode 100755 shell/hush_test/hush-misc/nommu3.tests (limited to 'shell/hush_test/hush-misc') 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 $? -- cgit v1.1