diff options
author | glennj <glennj@users.noreply.github.com> | 2014-02-05 17:26:34 +0800 |
---|---|---|
committer | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2014-02-05 17:26:34 +0800 |
commit | b475325b5e1510877093a7c731cb5a52e0550289 (patch) | |
tree | 16322b79a73df4ec69e1b2a4a8a369ff3a5d28ab /share/functions/math.fish | |
parent | 7e769252e7060dbe78e97d5cece69a919424d81d (diff) |
math.fish: exit if no output (e.g. from syntax error)
Closes #1175
Diffstat (limited to 'share/functions/math.fish')
-rw-r--r-- | share/functions/math.fish | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/share/functions/math.fish b/share/functions/math.fish index b262fd3b..ced85aad 100644 --- a/share/functions/math.fish +++ b/share/functions/math.fish @@ -8,6 +8,7 @@ function math --description "Perform math calculations in bc" end set -l out (echo $argv|env BC_LINE_LENGTH=0 bc) + test -z "$out"; and return 1 echo $out switch $out case 0 |