From ac81bd78a2a460253dd424f6152cb8a1555127da Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 17 Dec 2013 12:49:56 +0000 Subject: [PATCH] core: account for case-insensitive systems for data directories. --- src/sys/init.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sys/init.cpp b/src/sys/init.cpp index 4d452f24..f9ea01aa 100644 --- a/src/sys/init.cpp +++ b/src/sys/init.cpp @@ -12,6 +12,8 @@ # include "config.h" #endif +#include + #if HAVE_UNISTD_H # include #endif @@ -84,7 +86,13 @@ void Init(int argc, char *argv[], bool got_rootdir = false; for (int i = 0; ; i++) { - if (projectdir[i] != solutiondir[i] || projectdir[i] == '\0') +#if _WIN32 + using std::toupper; + bool mismatch = toupper(projectdir[i]) != toupper(solutiondir[i]); +#else + bool mismatch = projectdir[i] != solutiondir[i]; +#endif + if (mismatch || projectdir[i] == '\0') { /* FIXME: at this point we should check whether the binary * was launched from this subdirectory; from now we just