aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
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);