diff options
-rw-r--r-- | src/FbTk/StringUtil.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc index 0a7ebd3..f76a1f9 100644 --- a/src/FbTk/StringUtil.cc +++ b/src/FbTk/StringUtil.cc | |||
@@ -176,7 +176,7 @@ string expandFilename(const string &filename) { | |||
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 | retval = getenv("HOME"); | 178 | retval = getenv("HOME"); |
179 | if (pos != filename.size()) { | 179 | if (pos + 1 < filename.size()) { |
180 | // copy from the character after '~' | 180 | // copy from the character after '~' |
181 | retval += static_cast<const char *>(filename.c_str() + pos + 1); | 181 | retval += static_cast<const char *>(filename.c_str() + pos + 1); |
182 | } | 182 | } |