Fix sporadic cancellation test failures

If a Control-C is received during expanding a command substitution, we
may execute the job anyways, because we do not check for cancellation
after the expansion. Ensure that does not happen.

This should fix sporadic test failures in the cancellation unit test.
This commit is contained in:
ridiculousfish 2019-12-17 16:41:10 -08:00
parent 72de8768d9
commit ebc262cfba

View file

@ -926,6 +926,11 @@ parse_execution_result_t parse_execution_context_t::expand_arguments_from_nodes(
}
}
// We may have received a cancellation during this expansion.
if (parser->cancellation_requested) {
return parse_execution_cancelled;
}
return parse_execution_success;
}