aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_execution.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-02-12 01:39:06 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-02-12 01:39:06 -0800
commit29ddb68da428804148a0c6f44229cf1848bebf8c (patch)
tree7f304efea5fb102d04b47d59410ab74fa1317918 /parse_execution.cpp
parentdd49399e45558b1ee494a01628b7cbfbcf0919ff (diff)
Tests and fix to allow return to work correctly within if statements. Closes #1297.
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 08f222ed..11aa5325 100644
--- a/parse_execution.cpp
+++ b/parse_execution.cpp
@@ -325,6 +325,12 @@ parse_execution_result_t parse_execution_context_t::run_if_statement(const parse
{
run_job_list(*job_list_to_execute, ib);
}
+
+ /* It's possible there's a last-minute cancellation, in which case we should not stomp the exit status (#1297) */
+ if (should_cancel_execution(ib))
+ {
+ result = parse_execution_cancelled;
+ }
/* Done */
parser->pop_block(ib);