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

Re: exec last command in last pipeline.



On Aug 15,  1:04am, Tanaka Akira wrote:
} Subject: exec last command in last pipeline.
}
} --- exec.c	1999/07/24 14:02:56	1.1.1.19
} +++ exec.c	1999/08/14 15:55:32
} @@ -1522,7 +1522,7 @@
}  
}  	    /* Current shell should not fork unless the *
}  	     * exec occurs at the end of a pipeline.    */
} -	    if ((cflags & BINF_EXEC) && last1 == 2)
} +	    if ((cflags & BINF_EXEC) && last1)
}  		flags |= CFLAG_EXEC;
}  
}  	    /* Empty command */

I'm extremely dubious of that change.  The only way that last1 can be set
to 2 is here in execpline2():

    if (pline->type == END)
    	execcmd(pline->left, input, output, how, last1 ? 1 : 2);

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.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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