aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/shell/ash.c b/shell/ash.c
index c27ab7de2..ec887e088 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5451,15 +5451,8 @@ ash_arith(const char *s)
INT_OFF;
result = arith(&math_state, s);
- if (math_state.errcode < 0) {
- if (math_state.errcode == -3)
- ash_msg_and_raise_error("exponent less than 0");
- if (math_state.errcode == -2)
- ash_msg_and_raise_error("divide by zero");
- if (math_state.errcode == -5)
- ash_msg_and_raise_error("expression recursion loop detected");
- raise_error_syntax(s);
- }
+ if (math_state.errmsg)
+ ash_msg_and_raise_error(math_state.errmsg);
INT_ON;
return result;