`calc` builtin has strange behavior when a parenthesis is the last character
Created by: huntergoldstein
Reproduction: Attempt to use the command:
calc "5 * 6 - (7 ** 3)"
Expected behavior:
$ calc "5 * 6 - (7 ** 3)"
-313
Actual behavior:
$ calc "5 * 6 - (7 ** 3)"
thread '<unnamed>' panicked at 'byte index 20 is out of bounds of `"5 * 6 - (7 ** 3)"`', /checkout/src/libcore/str/mod.rs:2133
note: Run with `RUST_BACKTRACE=1` for a backtrace
$ calc "5 * 6 - (4 + 4)"
<calc waits for input>
Build information:
-
rustc -V
:rustc 1.20.0-nightly (445077963 2017-06-20)
-
git rev-parse HEAD
:f16d4aef1bde530e47e956cf2c28f775a15a7b39
Blocking / Related: #243 (closed)