From ced36439642170f319be76187907bccc2ea32ce0 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 16 Apr 2014 18:22:38 +0000 Subject: [PATCH] gsu/gui: Fix regex for tree walk. If one directory name is a suffix of another, the regex for grep found both, which is bad. --- misc/gsu/gui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/gsu/gui b/misc/gsu/gui index 5b108e1..12c8b8b 100644 --- a/misc/gsu/gui +++ b/misc/gsu/gui @@ -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%%:*}" -- 2.39.2