hush: fix this case: echo "SCRIPT" | hush
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
46a71dc30c
commit
1237d627e9
2
shell/ash_test/ash-misc/piped_input.right
Normal file
2
shell/ash_test/ash-misc/piped_input.right
Normal file
@ -0,0 +1,2 @@
|
||||
TEST
|
||||
One:1
|
3
shell/ash_test/ash-misc/piped_input.tests
Executable file
3
shell/ash_test/ash-misc/piped_input.tests
Executable file
@ -0,0 +1,3 @@
|
||||
exed 2>&1
|
||||
echo 'echo TEST; false' | $THIS_SH
|
||||
echo One:$?
|
@ -7787,7 +7787,11 @@ static void restore_redirects(struct squirrel *sq)
|
||||
free(sq);
|
||||
}
|
||||
if (G.HFILE_stdin
|
||||
&& G.HFILE_stdin->fd != STDIN_FILENO
|
||||
&& G.HFILE_stdin->fd > STDIN_FILENO
|
||||
/* we compare > STDIN, not == STDIN, since hfgetc()
|
||||
* closes fd and sets ->fd to -1 if EOF is reached.
|
||||
* Testcase: echo 'pwd' | hush
|
||||
*/
|
||||
) {
|
||||
/* Testcase: interactive "read r <FILE; echo $r; read r; echo $r".
|
||||
* Redirect moves ->fd to e.g. 10,
|
||||
|
2
shell/hush_test/hush-misc/piped_input.right
Normal file
2
shell/hush_test/hush-misc/piped_input.right
Normal file
@ -0,0 +1,2 @@
|
||||
TEST
|
||||
One:1
|
3
shell/hush_test/hush-misc/piped_input.tests
Executable file
3
shell/hush_test/hush-misc/piped_input.tests
Executable file
@ -0,0 +1,3 @@
|
||||
exed 2>&1
|
||||
echo 'echo TEST; false' | $THIS_SH
|
||||
echo One:$?
|
Loading…
Reference in New Issue
Block a user