diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-09 18:20:38 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-09 18:20:38 +0300 |
commit | 870da718e38555352343a46ce02fb46d5eb3a365 (patch) | |
tree | 63de16fdbaa5ea8d541e02cda7486f857e604fbc /butl | |
parent | 80d717aa12fbaa230a194c1902ea28e0a1b86586 (diff) |
Fix path_match() character case sensitivity on Windows
Diffstat (limited to 'butl')
-rw-r--r-- | butl/filesystem.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/butl/filesystem.cxx b/butl/filesystem.cxx index e792bef..5135281 100644 --- a/butl/filesystem.cxx +++ b/butl/filesystem.cxx @@ -21,6 +21,8 @@ # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) # endif + +# include <butl/utility> // lcase() #endif #include <errno.h> // errno, E* @@ -797,7 +799,11 @@ namespace butl char pc; for (; rpi != rpe && (pc = *rpi) != '*' && rni != rne; ++rpi, ++rni) { +#ifndef _WIN32 if (*rni != pc && pc != '?') +#else + if (lcase (*rni) != lcase (pc) && pc != '?') +#endif return false; } @@ -832,7 +838,11 @@ namespace butl // for (; (pc = *pi) != '*' && ni != ne; ++pi, ++ni) { +#ifndef _WIN32 if (*ni != pc && pc != '?') +#else + if (lcase (*ni) != lcase (pc) && pc != '?') +#endif return false; } |