projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5fa0505
)
hush: fix mishandling of "true | f() { echo QWE; }"
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 3 Apr 2018 11:02:43 +0000
(13:02 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 3 Apr 2018 11:02:43 +0000
(13:02 +0200)
function old new delta
run_pipe 1820 1826 +6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/hush.c
patch
|
blob
|
history
diff --git
a/shell/hush.c
b/shell/hush.c
index b64993faa8fcc32f027a20affb931433bea71b7c..94e429c0d452d3c58e1e0a869dbb52046ef3fbf7 100644
(file)
--- a/
shell/hush.c
+++ b/
shell/hush.c
@@
-7705,6
+7705,15
@@
static void pseudo_exec(nommu_save_t *nommu_save,
struct command *command,
char **argv_expanded)
{
+#if ENABLE_HUSH_FUNCTIONS
+ if (command->cmd_type == CMD_FUNCDEF) {
+ /* Ignore funcdefs in pipes:
+ * true | f() { cmd }
+ */
+ _exit(0);
+ }
+#endif
+
if (command->argv) {
pseudo_exec_argv(nommu_save, command->argv,
command->assignment_cnt, argv_expanded);