summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-01-01 02:44:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-01 23:32:37 (GMT)
commitc41244e702fd4fc1039f39a3915ae1e5f165bbf3 (patch)
tree2556fe7cadc647a95290472a832e32a784985090 /dir.c
parent0c528168dadd4209de0213a16ff811a89ee3f206 (diff)
downloadgit-c41244e702fd4fc1039f39a3915ae1e5f165bbf3.zip
git-c41244e702fd4fc1039f39a3915ae1e5f165bbf3.tar.gz
git-c41244e702fd4fc1039f39a3915ae1e5f165bbf3.tar.bz2
wildmatch: support "no FNM_PATHNAME" mode
So far, wildmatch() has always honoured directory boundary and there was no way to turn it off. Make it behave more like fnmatch() by requiring all callers that want the FNM_PATHNAME behaviour to pass that in the equivalent flag WM_PATHNAME. Callers that do not specify WM_PATHNAME will get wildcards like ? and * in their patterns matched against '/', just like not passing FNM_PATHNAME to fnmatch(). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 175a182..6ef0396 100644
--- a/dir.c
+++ b/dir.c
@@ -595,7 +595,7 @@ int match_pathname(const char *pathname, int pathlen,
}
return wildmatch(pattern, name,
- ignore_case ? WM_CASEFOLD : 0,
+ WM_PATHNAME | (ignore_case ? WM_CASEFOLD : 0),
NULL) == 0;
}