瀏覽代碼

core: account for case-insensitive systems for data directories.

undefined
Sam Hocevar 12 年之前
父節點
當前提交
ac81bd78a2
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. +9
    -1
      src/sys/init.cpp

+ 9
- 1
src/sys/init.cpp 查看文件

@@ -12,6 +12,8 @@
# include "config.h" # include "config.h"
#endif #endif


#include <cctype>

#if HAVE_UNISTD_H #if HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
@@ -84,7 +86,13 @@ void Init(int argc, char *argv[],
bool got_rootdir = false; bool got_rootdir = false;
for (int i = 0; ; i++) 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 /* FIXME: at this point we should check whether the binary
* was launched from this subdirectory; from now we just * was launched from this subdirectory; from now we just


Loading…
取消
儲存