Clean up the return type of parser_t::eval

parser_t::eval indicates whether there was a parse error. It can be
easily confused with the status of the execution. Use a real type to
make it more clear.
This commit is contained in:
ridiculousfish
2019-12-17 15:39:05 -08:00
parent 4f3b3f7d61
commit 09f8e05b80
6 changed files with 52 additions and 34 deletions

View File

@@ -1183,7 +1183,7 @@ static int exec_subshell_internal(const wcstring &cmd, parser_t &parser, wcstrin
// be null.
std::shared_ptr<io_buffer_t> buffer;
if (auto bufferfill = io_bufferfill_t::create(fd_set_t{}, ld.read_limit)) {
if (parser.eval(cmd, io_chain_t{bufferfill}, SUBST) == 0) {
if (parser.eval(cmd, io_chain_t{bufferfill}, SUBST) == eval_result_t::ok) {
subcommand_statuses = parser.get_last_statuses();
}
buffer = io_bufferfill_t::finish(std::move(bufferfill));