We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32264c8 commit 01f7d86Copy full SHA for 01f7d86
repl/single.cpp
@@ -24,15 +24,17 @@ load_and_execute_single_noreturn()
24
25
// Execute the script, passing all command-line arguments to it. If the
26
// script exits without returning a value, success is assumed.
27
+ Exit_Status status = exit_non_integer;
28
auto ref = repl_script.execute(move(repl_args));
29
if(ref.is_void())
- quick_exit();
30
-
31
- const auto& val = ref.dereference_readonly();
32
- if(val.is_integer())
33
- quick_exit(static_cast<Exit_Status>(val.as_integer()));
+ status = exit_success;
+ else {
+ const auto& val = ref.dereference_readonly();
+ if(val.is_integer())
34
+ status = static_cast<Exit_Status>(val.as_integer());
35
+ }
36
- quick_exit(exit_non_integer);
37
+ quick_exit(status);
38
}
39
40
} // namespace asteria
0 commit comments