Make if statements always return success at the end, matching other

shells. Fixes #1061.
This commit is contained in:
ridiculousfish
2014-02-07 17:56:40 -08:00
parent 09054a09fa
commit e632d39b1f
4 changed files with 16 additions and 0 deletions

View File

@@ -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;
}