]> git.tuebingen.mpg.de Git - gsu.git/blobdiff - misc/gsu/gui
gsu/gui: Fix regex for tree walk.
[gsu.git] / misc / gsu / gui
index 30c95a43d662e17067cc058f1ce0eb14b3f14fe7..12c8b8b7685f346e7bccb0ff4aecd5788350f01b 100644 (file)
@@ -154,7 +154,7 @@ _get_subtree()
        local tree="$1" root="${2%/}"
        local TAB='     '
 
-       first="$(grep -n "$root/" <<< "$tree")"
+       first="$(grep -n "$TAB\{1,\}$root/" <<< "$tree")"
        [[ -z "$first" ]] && return
 
        line_num="${first%%:*}"
@@ -201,6 +201,11 @@ gsu_gui()
        local tree="$1" subtree
 
        _gsu_setup
+       type -t dialog &> /dev/null
+       if (($? != 0)); then
+               gsu_msg "dialog executable not found"
+               exit 1
+       fi
        _get_root_nodes "$tree"
        subtree="$result"
        _browse "$gsu_name main menu" "$tree" "$subtree"