wildmatch: support "no FNM_PATHNAME" mode
commitc41244e702fd4fc1039f39a3915ae1e5f165bbf3
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Tue, 1 Jan 2013 02:44:07 +0000 (1 09:44 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Jan 2013 23:32:37 +0000 (1 15:32 -0800)
tree2556fe7cadc647a95290472a832e32a784985090
parent0c528168dadd4209de0213a16ff811a89ee3f206
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>
dir.c
t/t3070-wildmatch.sh
test-wildmatch.c
wildmatch.c
wildmatch.h