aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-04-03 13:02:43 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-04-03 13:02:43 +0200
commit49015a60cb334ecd0b069f27833a3d50853509fa (patch)
treec02f74e1438b199fb5f8b999e57a151cec006a75 /shell
parent5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6 (diff)
downloadbusybox-w32-49015a60cb334ecd0b069f27833a3d50853509fa.tar.gz
busybox-w32-49015a60cb334ecd0b069f27833a3d50853509fa.tar.bz2
busybox-w32-49015a60cb334ecd0b069f27833a3d50853509fa.zip
hush: fix mishandling of "true | f() { echo QWE; }"
function old new delta run_pipe 1820 1826 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index b64993faa..94e429c0d 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -7705,6 +7705,15 @@ static void pseudo_exec(nommu_save_t *nommu_save,
7705 struct command *command, 7705 struct command *command,
7706 char **argv_expanded) 7706 char **argv_expanded)
7707{ 7707{
7708#if ENABLE_HUSH_FUNCTIONS
7709 if (command->cmd_type == CMD_FUNCDEF) {
7710 /* Ignore funcdefs in pipes:
7711 * true | f() { cmd }
7712 */
7713 _exit(0);
7714 }
7715#endif
7716
7708 if (command->argv) { 7717 if (command->argv) {
7709 pseudo_exec_argv(nommu_save, command->argv, 7718 pseudo_exec_argv(nommu_save, command->argv,
7710 command->assignment_cnt, argv_expanded); 7719 command->assignment_cnt, argv_expanded);