]> git.tuebingen.mpg.de Git - gsu.git/commitdiff
gsu/gui: Fix regex for tree walk.
authorAndre Noll <maan@systemlinux.org>
Wed, 16 Apr 2014 18:22:38 +0000 (18:22 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Aug 2014 19:39:58 +0000 (21:39 +0200)
If one directory name is a suffix of another, the regex
for grep found both, which is bad.

misc/gsu/gui

index 5b108e1ad4521d74ec5a8b6a16c061484c8a0cef..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%%:*}"