Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: exec last command in last pipeline.



In article <990814220530.ZM6932@xxxxxxxxxxxxxxxxxxxxxxx>,
  "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:

> If you remove the test of last1 == 2 in execcmd(), there's no reason to
> test for last1 in execpline2().  But both tests have been there since
> before version 3.0.0; I'm concerned that the shell is going to exec in
> some cases where it should not.

    if ((how & Z_ASYNC) || (!(flags & CFLAG_EXEC) &&
       (((is_builtin || is_shfunc) && output) ||
       (!is_cursh && (last1 != 1 || sigtrapped[SIGZERR] ||
        sigtrapped[SIGEXIT] || havefiles()))))) {

and
            if (last1 == 1)

(and
                DPUTS(last1 != 1 && !forked, "BUG: not exiting?");
)

can be the reason to set last1 to 2 instead of 1.
-- 
Tanaka Akira



Messages sorted by: Reverse Date, Date, Thread, Author