aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_execution.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-02-07 17:56:40 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-02-07 17:57:53 -0800
commite632d39b1f627773b29f7934d7d79545af75e47f (patch)
tree2222b1a5364128f8e7812ecbbc33f310ba59c6dd /parse_execution.cpp
parent09054a09fa8aef98229ea132f9043ead7f7e1e0e (diff)
Make if statements always return success at the end, matching other
shells. Fixes #1061.
Diffstat (limited to 'parse_execution.cpp')
-rw-r--r--parse_execution.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/parse_execution.cpp b/parse_execution.cpp
index 68a27b4d..d0d8336b 100644
--- a/parse_execution.cpp
+++ b/parse_execution.cpp
@@ -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;
}