main.cc,FbTk/StringUtil.cc: On windows, use USERPROFILE instead of HOME
Ryan Pavlik rpavlik@iastate.edu
2 files changed,
8 insertions(+),
1 deletions(-)
M
src/FbTk/StringUtil.cc
→
src/FbTk/StringUtil.cc
@@ -175,7 +175,11 @@ string expandFilename(const string &filename) {
string retval; size_t pos = filename.find_first_not_of(" \t"); if (pos != string::npos && filename[pos] == '~') { +#ifdef _WIN32 + retval = getenv("USERPROFILE"); +#else retval = getenv("HOME"); +#endif if (pos + 1 < filename.size()) { // copy from the character after '~' retval += static_cast<const char *>(filename.c_str() + pos + 1);
M
src/main.cc
→
src/main.cc
@@ -224,8 +224,11 @@ env = getenv("DISPLAY");
if (env && strlen(env) > 0) { session_display.assign(env); } - +#ifdef _WIN32 + env = getenv("USERPROFILE"); +#else env = getenv("HOME"); +#endif if (env && strlen(env) > 0) { rc_path.assign(std::string(env) + "/." + realProgramName("fluxbox")); rc_file = rc_path + "/init";