diff options
Diffstat (limited to 'src/attr_file.c')
-rw-r--r-- | src/attr_file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/attr_file.c b/src/attr_file.c index a7cc5916d..5ec5b4408 100644 --- a/src/attr_file.c +++ b/src/attr_file.c @@ -401,10 +401,9 @@ bool git_attr_fnmatch__match( path->basename == path->path) return false; - /* for ignore checks, use container of current item for check */ - path->basename[-1] = '\0'; flags |= FNM_LEADING_DIR; + /* for ignore checks, use container of current item for check */ if (match->containing_dir) matchpath = path->basename; else @@ -419,7 +418,7 @@ bool git_attr_fnmatch__match( return false; matchval = p_fnmatch(match->pattern, matchpath, flags); - path->basename[-1] = '/'; + return (matchval != FNM_NOMATCH); } |