diff options
author | Chet Ramey <chet.ramey@case.edu> | 2014-01-29 17:00:07 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2014-01-29 17:00:07 -0500 |
commit | b6e23235f28b1c85e18e9a2b7ba8c6b6c46aecbc (patch) | |
tree | 00fdd9c37c261d89c994fc1856252df719afec3a /expr.c | |
parent | 8581f42df9a1b1d848e2d4bdf3cc951b8d14b5be (diff) | |
download | bash-4.3-testing.tar.gz |
bash-4.3-rc2 overlaybash-4.3-rc2bash-4.3-testing
Diffstat (limited to 'expr.c')
-rw-r--r-- | expr.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -839,7 +839,9 @@ exp2 () (curtok == MOD)) { int op = curtok; + char *stp, *sltp; + stp = tp; readtok (); val2 = exppower (); @@ -848,7 +850,14 @@ exp2 () if (((op == DIV) || (op == MOD)) && (val2 == 0)) { if (noeval == 0) - evalerror (_("division by 0")); + { + sltp = lasttp; + lasttp = stp; + while (lasttp && *lasttp && whitespace (*lasttp)) + lasttp++; + evalerror (_("division by 0")); + lasttp = sltp; + } else val2 = 1; } |