Fix the path_filter to accept . as a current directory prefix
authorPat Thoyts <patthoyts@users.sourceforge.net>
Thu, 25 Feb 2010 11:10:26 +0000 (11:10 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Thu, 25 Feb 2010 11:10:26 +0000 (11:10 +0000)
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
gitk

diff --git a/gitk b/gitk
index 7f573e0171819e44a771bc5bc0e103910af64936..75a4e1d1b7b0ca0ff4da9143fb48423538e956d0 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -7339,19 +7339,12 @@ proc startdiff {ids} {
 }
 
 proc path_filter {filter name} {
+    set name [file normalize $name]
     foreach p $filter {
-       set l [string length $p]
-       if {[string index $p end] eq "/"} {
-           if {[string compare -length $l $p $name] == 0} {
-               return 1
-           }
-       } else {
-           if {[string compare -length $l $p $name] == 0 &&
-               ([string length $name] == $l ||
-                [string index $name $l] eq "/")} {
-               return 1
-           }
-       }
+        set p [file normalize $p]
+        if {[string equal $p $name] || [string match $p* $name]} {
+            return 1
+        }
     }
     return 0
 }