Merge pull request #1057 from kwkam/patch-1

util: also detect xdg_* env variables on windows
pull/1060/merge
Tatsuhiro Tsujikawa 2017-11-05 16:01:27 +09:00 committed by GitHub
commit f198cd4ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -1441,7 +1441,13 @@ std::string getXDGDir(const std::string& environmentVariable,
{
std::string filename;
const char* p = getenv(environmentVariable.c_str());
if (p && p[0] == '/') {
if (p &&
#ifndef __MINGW32__
p[0] == '/'
#else // __MINGW32__
p[0] && p[1] == ':'
#endif // __MINGW32__
) {
filename = p;
}
else {