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:
Kim Grasman 2019-11-17 20:16:43 +01:00 committed by Kim Gräsman
parent 30f7a784d5
commit 3538843036
1 changed files with 1 additions and 1 deletions

2
port.h
View File

@ -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)