Larry's variant on Evin Robertson's fix to what I messed up
[oweals/busybox.git] / shell / hush.c
index a7316f82eabcb8c98ea5daab55b43066c26576f3..b8e4a55c26bf8914114306ccce6ffd2a1b51f112 100644 (file)
@@ -1019,7 +1019,6 @@ static void pseudo_exec(struct child_prog *child)
                        optind = 1;
                        debug_printf("running applet %s\n", name);
                        run_applet_by_name(name, argc_l, child->argv);
-                       exit(1);
                }
 #endif
                debug_printf("exec of %s\n",child->argv[0]);
@@ -1186,7 +1185,7 @@ static int run_pipe_real(struct pipe *pi)
        pi->pgrp = 0;
 
        /* Check if we are supposed to run in the foreground */
-       if (pi->followup!=PIPE_BG) {
+       if (interactive && pi->followup!=PIPE_BG) {
                if ((pi->pgrp = tcgetpgrp(ctty = 2)) < 0
                                && (pi->pgrp = tcgetpgrp(ctty = 0)) < 0
                                && (pi->pgrp = tcgetpgrp(ctty = 1)) < 0)
@@ -1661,7 +1660,6 @@ int reserved_word(o_string *dest, struct p_context *ctx)
                                old->child->group = ctx->list_head;
                                *ctx = *old;   /* physical copy */
                                free(old);
-                               ctx->w=RES_NONE;
                        }
                        b_reset (dest);
                        return 1;