fix/expr: EXIT_CODE=1 for any return output parsable to 0 (or empty)

This commit is contained in:
Roy Ivy III
2022-12-29 22:49:02 -06:00
parent 812d811ff6
commit 8753fb95c3
+1 -1
View File
@@ -74,7 +74,7 @@ fn process_expr(token_strings: &[&str]) -> Result<String, String> {
fn print_expr_ok(expr_result: &str) -> UResult<()> {
println!("{}", expr_result);
if expr_result == "0" || expr_result.is_empty() {
if expr_result.parse::<i32>() == Ok(0) || expr_result.is_empty() {
Err(1.into())
} else {
Ok(())