소스 검색

util: also detect xdg_* env variables on windows

so if people like to keep FHS they could define XDG_* for it
kwkam 8 년 전
부모
커밋
5c6bcfd2ad
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      src/util.cc

+ 7 - 1
src/util.cc

@@ -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 {