Expand glob matching on POSIX
Previously, GlobMatchesPath would always use FNM_PATHNAME, which does not let '*' match path separators. Loosen this so GlobMatchesPath can be used to match "any path name ending with 'xyz'" using "*xyz". This is a change in behavior for POSIX systems, but it seems like the Windows GlobMatchesPath always worked like this (being based on PathMatchSpec), so it creates a unified behavior across platforms.
This commit is contained in:
parent
30f7a784d5
commit
3538843036
2
port.h
2
port.h
|
@ -82,7 +82,7 @@ inline bool GlobMatchesPath(const char *glob, const char *path) {
|
|||
#include <fnmatch.h>
|
||||
|
||||
inline bool GlobMatchesPath(const char *glob, const char *path) {
|
||||
return fnmatch(glob, path, FNM_PATHNAME) == 0;
|
||||
return fnmatch(glob, path, 0) == 0;
|
||||
}
|
||||
|
||||
#endif // #if defined(_WIN32)
|
||||
|
|
Loading…
Reference in New Issue