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

Re: Function code breaking out of if then ...fi



On Sat, 10 Nov 2012 21:23:30 +0000
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Fri, 09 Nov 2012 17:13:19 -0800
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > When reading a startup file such as .zshrc, there is an intent to
> > avoid skipping the entire configuration just because of one
> > erroneous command somewhere in the middle.
> 
> I've a vague memory of this too, but evidence suggests it's not
> showing CONTINUE_ON_ERROR behaviour (this is before my patch):

In fact, the code I've altered can't have an effect on this:  as it says
in the essay I wrote before, I'm modifying code above the "top-level"
loop in loop(), that's called mainly to handle "do you really want to
exit" for interactive shells.  The initialisation code is not handled
from here; run_init_scripts() has finised from this point.  I think we'd
need code within loop() itself, which handles the lines read from
startup files.  In this code the test

	if (((!interact || sourcelevel) && errflag) || retflag)
	    break;

ensures we *do* break out of the loop if we're sourcing a file (whether
or not at initialisation).

Hmm... we're not getting confused between keeping going in a particular
startup file and allowing the shell to execute another file, are we?

pws



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