Simplify arithmetic evaluation.
[gsu.git] / common
diff --git a/common b/common
index 4b69b2351942178c22e7cc9141713bce5b62e0d6..374b81e0498defc0d6895d3617fe3970f06a3cd3 100644 (file)
--- a/common
+++ b/common
@@ -31,7 +31,7 @@ ${gsu_errors:-}
                #echo "a:$a,  b: $b"
                gsu_error_txt[i]="$b"
                eval $a=$i
-               i=$(($i + 1))
+               i=$((i + 1))
        done << EOF
        $gsu_errors
 EOF
@@ -68,15 +68,15 @@ gsu_err_msg()
        local txt="$result" err
 
        gsu_is_a_number "$ret"
-       if (($ret < 0)); then
+       if ((ret < 0)); then
                gsu_msg "unknown error ($ret:$txt)"
                exit 1
        fi
-       if (($result >= 0)); then
+       if ((result >= 0)); then
                gsu_msg "unknown error ($result:$txt)"
                exit 1
        fi
-       err=$((0 - $result))
+       err=$((0 - result))
        if test -n "$txt"; then
                txt="$txt: ${gsu_error_txt[$err]}"
        else