mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-17 11:01:14 -03:00
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:
@@ -254,7 +254,8 @@ int run_command_list(std::vector<std::string> *cmds, const io_chain_t &io) {
|
||||
|
||||
for (const auto &cmd : *cmds) {
|
||||
const wcstring cmd_wcs = str2wcstring(cmd);
|
||||
res = parser.eval(cmd_wcs, io, TOP);
|
||||
eval_result_t eval_res = parser.eval(cmd_wcs, io, TOP);
|
||||
res = (eval_res == eval_result_t::ok ? 0 : 1);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user