Simplify arithmetic evaluation.
[gsu.git] / gui
diff --git a/gui b/gui
index 23e9e90..4297564 100644 (file)
--- a/gui
+++ b/gui
@@ -20,7 +20,7 @@ _get_geometry()
        fi
        x="${result#* }"
        y="${result%% *}"
-       (($x > 190)) && x=190
+       ((x > 190)) && x=190
        result="$y $x"
 }
 
@@ -85,7 +85,7 @@ gsu_msgbox()
        # Some versions of dialog segfault if the text is too long. Hence we
        # always use a temporary file.
        gsu_make_tempfile 'gsu_msgbox.XXXXXXXXXX'
-       (($ret < 0)) && return
+       ((ret < 0)) && return
        tmp="$result"
        trap "rm -f $tmp" EXIT
        echo "$1" > "$tmp"
@@ -132,7 +132,7 @@ _get_subtree()
        #echo "line: $line_num, root: $root, indent level: $level"
        result="$(sed -e "1,${line_num}d;" <<< "$tree" \
                | sed -e "/^$TAB\{1,$level\}$_gsu_node_name_pattern/,\$d" \
-               | sed -e "/^$TAB\{$(($level + 2))\}/d")"
+               | sed -e "/^$TAB\{$((level + 2))\}/d")"
        if (($? != 0)); then
                ret=-$E_GSU_MENU_TREE
                result="sed command for subtree $root failed"
@@ -161,15 +161,15 @@ _browse()
 
        while :; do
                _gsu_menu "$header" "$subtree"
-               (($ret < 0)) && return
+               ((ret < 0)) && return
                [[ -z "$result" ]] && return # menu was cancelled
                if [[ "${result%/}" != "$result" ]]; then
                        old_header="$header"
                        header="$result"
                        _get_subtree "$tree" "$header"
-                       (($ret < 0)) && return
+                       ((ret < 0)) && return
                        _browse "$header" "$tree" "$result"
-                       (($ret < 0)) && return
+                       ((ret < 0)) && return
                        header="$old_header"
                        continue
                fi