diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/StringUtil.cc | 4 | ||||
-rw-r--r-- | src/main.cc | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc index f76a1f9..ec1f936 100644 --- a/src/FbTk/StringUtil.cc +++ b/src/FbTk/StringUtil.cc | |||
@@ -175,7 +175,11 @@ string expandFilename(const string &filename) { | |||
175 | string retval; | 175 | string retval; |
176 | size_t pos = filename.find_first_not_of(" \t"); | 176 | size_t pos = filename.find_first_not_of(" \t"); |
177 | if (pos != string::npos && filename[pos] == '~') { | 177 | if (pos != string::npos && filename[pos] == '~') { |
178 | #ifdef _WIN32 | ||
179 | retval = getenv("USERPROFILE"); | ||
180 | #else | ||
178 | retval = getenv("HOME"); | 181 | retval = getenv("HOME"); |
182 | #endif | ||
179 | if (pos + 1 < filename.size()) { | 183 | if (pos + 1 < filename.size()) { |
180 | // copy from the character after '~' | 184 | // copy from the character after '~' |
181 | retval += static_cast<const char *>(filename.c_str() + pos + 1); | 185 | retval += static_cast<const char *>(filename.c_str() + pos + 1); |
diff --git a/src/main.cc b/src/main.cc index f294db3..8aea835 100644 --- a/src/main.cc +++ b/src/main.cc | |||
@@ -224,8 +224,11 @@ struct Options { | |||
224 | if (env && strlen(env) > 0) { | 224 | if (env && strlen(env) > 0) { |
225 | session_display.assign(env); | 225 | session_display.assign(env); |
226 | } | 226 | } |
227 | 227 | #ifdef _WIN32 | |
228 | env = getenv("USERPROFILE"); | ||
229 | #else | ||
228 | env = getenv("HOME"); | 230 | env = getenv("HOME"); |
231 | #endif | ||
229 | if (env && strlen(env) > 0) { | 232 | if (env && strlen(env) > 0) { |
230 | rc_path.assign(std::string(env) + "/." + realProgramName("fluxbox")); | 233 | rc_path.assign(std::string(env) + "/." + realProgramName("fluxbox")); |
231 | rc_file = rc_path + "/init"; | 234 | rc_file = rc_path + "/init"; |