From 41d8f1081378ec79586d59e7d2a31380b6f95577 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 5 Apr 2018 14:41:21 +0200 Subject: hush: fix corner cases with exec in empty expansions Cases like these: var=val exec >redir var=val `` >redir function old new delta run_pipe 1701 1723 +22 redirect_and_varexp_helper 56 55 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 22/-1) Total: 21 bytes Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-redir/redir_exec1.right | 3 +++ shell/hush_test/hush-redir/redir_exec1.tests | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 shell/hush_test/hush-redir/redir_exec1.right create mode 100755 shell/hush_test/hush-redir/redir_exec1.tests (limited to 'shell/hush_test') diff --git a/shell/hush_test/hush-redir/redir_exec1.right b/shell/hush_test/hush-redir/redir_exec1.right new file mode 100644 index 000000000..6ff8fc832 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_exec1.right @@ -0,0 +1,3 @@ +First +hush: can't open '/cant/be/created': No such file or directory +One:1 diff --git a/shell/hush_test/hush-redir/redir_exec1.tests b/shell/hush_test/hush-redir/redir_exec1.tests new file mode 100755 index 000000000..290e1cb39 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_exec1.tests @@ -0,0 +1,2 @@ +v=`echo First >&2` exec >/cant/be/created +echo One:$? -- cgit v1.2.3