Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
}
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
}