mirror of
https://github.com/sheumann/hush.git
synced 2024-08-21 11:28:57 +00:00
hush: fix a case where return in sourced file has no effect
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
20704f0662
commit
68d5cb5dac
@ -5554,6 +5554,10 @@ static void parse_and_run_stream(struct in_str *inp, int end_trigger)
|
||||
debug_printf_exec("parse_and_run_stream: run_and_free_list\n");
|
||||
run_and_free_list(pipe_list);
|
||||
empty = 0;
|
||||
#if ENABLE_HUSH_FUNCTIONS
|
||||
if (G.flag_return_in_progress == 1)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
1
shell/hush_test/hush-misc/return1.right
Normal file
1
shell/hush_test/hush-misc/return1.right
Normal file
@ -0,0 +1 @@
|
||||
Ok:0
|
4
shell/hush_test/hush-misc/return1.tests
Executable file
4
shell/hush_test/hush-misc/return1.tests
Executable file
@ -0,0 +1,4 @@
|
||||
echo "true && return; echo Should not be printed" >return_sourced
|
||||
. ./return_sourced
|
||||
rm return_sourced
|
||||
echo Ok:$?
|
Loading…
Reference in New Issue
Block a user