From 82881b38235d0a46a4486dc5dc819c5d0ee3f2c1 Mon Sep 17 00:00:00 2001 From: Matthew Ogilvie Date: Tue, 22 Apr 2008 12:19:12 -0600 Subject: gitattributes: Fix subdirectory attributes specified from root directory Signed-off-by: Matthew Ogilvie Signed-off-by: Junio C Hamano --- attr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'attr.c') diff --git a/attr.c b/attr.c index 64b77b1663..1a15fad294 100644 --- a/attr.c +++ b/attr.c @@ -546,7 +546,9 @@ static int path_matches(const char *pathname, int pathlen, (baselen && pathname[baselen] != '/') || strncmp(pathname, base, baselen)) return 0; - return fnmatch(pattern, pathname + baselen + 1, FNM_PATHNAME) == 0; + if (baselen != 0) + baselen++; + return fnmatch(pattern, pathname + baselen, FNM_PATHNAME) == 0; } static int fill_one(const char *what, struct match_attr *a, int rem) -- cgit v1.3-5-g9baa