mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 18:51:15 -03:00
Make if statements always return success at the end, matching other
shells. Fixes #1061.
This commit is contained in:
@@ -306,6 +306,12 @@ parse_execution_result_t parse_execution_context_t::run_if_statement(const parse
|
||||
/* Done */
|
||||
parser->pop_block(ib);
|
||||
|
||||
/* Issue 1061: If we executed, then always report success, instead of letting the exit status of the last command linger */
|
||||
if (result == parse_execution_success)
|
||||
{
|
||||
proc_set_last_status(STATUS_BUILTIN_OK);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user