From b475325b5e1510877093a7c731cb5a52e0550289 Mon Sep 17 00:00:00 2001 From: glennj Date: Wed, 5 Feb 2014 17:26:34 +0800 Subject: [PATCH] math.fish: exit if no output (e.g. from syntax error) Closes #1175 --- share/functions/math.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/share/functions/math.fish b/share/functions/math.fish index b262fd3bd..ced85aad4 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