You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following script prints 0 in ksh93, dash, and bash, but 1 in zsh:
fn() { return 1; }
(
set -e
if [ x = y ];then
fn ||:else
fn ||:fi:
)
echo$?
It doesn't attempt to execute the || : part at all, just immediately returns
after fn.
It seems like it has something to do specifically with calling a function inside
the body of an else. If i change x = y to x = x, then the first fn || :
behaves as expected. Or if i change fn to false, that works too. Or if i
remove the conditional entirely.
Bart replied:
See the thread w/Subject: "set -e" handling is broken with zsh 5.3.1 and 5.4.1
In particular workers/41608 and workers/41615 ... I wonder if you have
found the regression that wasn't found at the time of that patch.
At the very least this sounds related.
Still an issue in 5.5.1.
The text was updated successfully, but these errors were encountered:
(workers/42126)
Bart replied:
Still an issue in 5.5.1.
The text was updated successfully, but these errors were encountered: