math.fish: exit if no output (e.g. from syntax error)

Closes #1175
This commit is contained in:
glennj 2014-02-05 17:26:34 +08:00 committed by David Adam
parent 7e769252e7
commit b475325b5e

View File

@ -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