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

Re: Bug report



On Dec 26,  5:53pm, mvxxc@xxxxxx wrote:
} Subject: Bug report
}
} If the following script is run in an empty directory, zsh executes the
} defined function only once.

Changing this line:

}   set -e

To "set -exv" shows that func is in fact called twice but exits without
doing anything on the second call.

I therefore suspect one of workers/32568 or workers/32569.

This is very tricky because we have to propagate the value of $? from
before the "for" keyword (including before the start of the function)
into the "do" body, but must *not* *use* the value of $? for deciding
whether to exit-on-error, because the nonzero value came from an "if"
test.  There is a "noerrexit" flag that is supposed to cover this case,
but it's not set when the very first "sublist" in a function body is
a for-loop (there are likely to be other similar cases).



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