Fix space handling for different paths.

E.g. on my machine LLVM is installed in folder C:\My Program Files\LLVM.

Fixes part of issue #1465. (PR 1466 is required for complete fix.)
This commit is contained in:
Kai Nacke 2016-05-15 01:47:14 +02:00
parent 1508bafccc
commit cb0f2e7e6a
4 changed files with 26 additions and 20 deletions

View file

@ -131,16 +131,20 @@ bool ConfigFile::locate() {
APPEND_FILENAME_AND_RETURN_IF_EXISTS
}
#else
#define STR(x) #x
#define XSTR(x) STR(x)
// try the install-prefix/etc
p = LDC_INSTALL_PREFIX;
p = XSTR(LDC_INSTALL_PREFIX);
sys::path::append(p, "etc");
APPEND_FILENAME_AND_RETURN_IF_EXISTS
// try the install-prefix/etc/ldc
p = LDC_INSTALL_PREFIX;
p = XSTR(LDC_INSTALL_PREFIX);
sys::path::append(p, "etc");
sys::path::append(p, "ldc");
APPEND_FILENAME_AND_RETURN_IF_EXISTS
#undef XSTR
#undef STR
// try /etc (absolute path)
p = "/etc";