X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=attr.c;h=1a15fad294c5db1f922e686995e215b94b89b9a0;hb=3562198b7da7ef6597af27b3a7fcaeee41608999;hp=741db3b468c6a6ebbcd1414e42b4ef7d6ab3cc9d;hpb=e2b7eaf0ca3897940961d23392d4ff718867ea9f;p=git.git diff --git a/attr.c b/attr.c index 741db3b46..1a15fad29 100644 --- a/attr.c +++ b/attr.c @@ -406,7 +406,7 @@ static void debug_info(const char *what, struct attr_stack *elem) { fprintf(stderr, "%s: %s\n", what, elem->origin ? elem->origin : "()"); } -static void debug_set(const char *what, const char *match, struct git_attr *attr, void *v) +static void debug_set(const char *what, const char *match, struct git_attr *attr, const void *v) { const char *value = v; @@ -543,9 +543,11 @@ static int path_matches(const char *pathname, int pathlen, if (*pattern == '/') pattern++; if (pathlen < baselen || - (baselen && pathname[baselen - 1] != '/') || + (baselen && pathname[baselen] != '/') || strncmp(pathname, base, baselen)) return 0; + if (baselen != 0) + baselen++; return fnmatch(pattern, pathname + baselen, FNM_PATHNAME) == 0; }