git/wildmatch.h
Nguyễn Thái Ngọc Duy c41244e702 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>
2013-01-01 15:32:37 -08:00

19 lines
346 B
C

#ifndef WILDMATCH_H
#define WILDMATCH_H
#define WM_CASEFOLD 1
#define WM_PATHNAME 2
#define WM_ABORT_MALFORMED 2
#define WM_NOMATCH 1
#define WM_MATCH 0
#define WM_ABORT_ALL -1
#define WM_ABORT_TO_STARSTAR -2
struct wildopts;
int wildmatch(const char *pattern, const char *text,
unsigned int flags,
struct wildopts *wo);
#endif