summaryrefslogtreecommitdiff
path: root/util/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'util/scripts')
-rw-r--r--util/scripts/maintainers.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go
index 459c030d13..c68ea058f0 100644
--- a/util/scripts/maintainers.go
+++ b/util/scripts/maintainers.go
@@ -77,11 +77,14 @@ func get_maintainers() ([]string, error) {
}
func path_to_regexstr(path string) string {
- // if prefix, allow all subdirectories
- if path[len(path)-1] == '/' {
- path += "*"
+ regexstr := glob_to_regex(path)
+
+ /* Handle path with trailing '/' as prefix */
+ if regexstr[len(regexstr)-2:] == "/$" {
+ regexstr = regexstr[:len(regexstr)-1] + ".*$"
}
- return glob_to_regex(path)
+
+ return regexstr;
}
func path_to_regex(path string) *regexp.Regexp {
@@ -200,7 +203,7 @@ func glob_to_regex(glob string) string {
}
case '*':
if inClass == 0 {
- regex += ".*"
+ regex += "[^/]*"
} else {
regex += "*"
}