aboutsummaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-23 00:03:56 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-23 00:03:56 -0700
commit57cf5ca3058b4086744f59f1f520a15dfc040bbb (patch)
treeb89a069c701db1d5eb64d7c74928b2f66db9833d /attr.c
parentbdb87afb4b425d97f7b5e957cbed1589969d9a24 (diff)
parentd6958a1a32814af69a7571daa45252018c61f969 (diff)
downloadgit-57cf5ca3058b4086744f59f1f520a15dfc040bbb.tar.xz
Merge branch 'maint'
* maint: Amend git-push refspec documentation git-gc --prune is deprecated svn-git: Use binmode for reading/writing binary rev maps diff options documentation: refer to --diff-filter in --name-status Don't force imap.host to be set when imap.tunnel is set git-clone.txt: Adjust note to --shared for new pruning behavior of git-gc git-svn bug with blank commits and author file archive.c: format_subst - fixed bogus argument to memchr copy.c: copy_fd - correctly report write errors gitattributes: Fix subdirectory attributes specified from root directory
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c4
1 files changed, 3 insertions, 1 deletions
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)