summaryrefslogtreecommitdiff
path: root/src/util.cc
diff options
context:
space:
mode:
authorkwkam <kwkam@users.noreply.github.com>2017-11-04 21:49:01 +0800
committerGitHub <noreply@github.com>2017-11-04 21:49:01 +0800
commit5c6bcfd2adf84189d1e504ac602c0377d7852637 (patch)
tree5b4b036f2fe1f56c6f3896e6c76f3e124fb70b41 /src/util.cc
parentaafa368885fb6b725e5e19b0b20f08a4cf4caa8b (diff)
util: also detect xdg_* env variables on windows
so if people like to keep FHS they could define XDG_* for it
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util.cc b/src/util.cc
index 40fc55f2..6c1aed26 100644
--- a/src/util.cc
+++ b/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 {