aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorRyan Pavlik <rpavlik@iastate.edu>2011-10-28 21:15:13 (GMT)
committerRyan Pavlik <rpavlik@iastate.edu>2011-10-31 15:54:32 (GMT)
commit25d04827b5e754c4d898240de8676eb89d105eb6 (patch)
tree2af67f2c48f4891f9c3db045e07d34b50ced668b /src/FbTk
parentf77f5d461ba22f9e4c2af85c8666501207c163c0 (diff)
downloadfluxbox-25d04827b5e754c4d898240de8676eb89d105eb6.zip
fluxbox-25d04827b5e754c4d898240de8676eb89d105eb6.tar.bz2
main.cc,FbTk/StringUtil.cc: On windows, use USERPROFILE instead of HOME
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/StringUtil.cc4
1 files changed, 4 insertions, 0 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);