summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-12-06 21:50:54 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-12-06 21:50:54 (GMT)
commit82b3ed83d4cef6105afe4bee645e61991836509e (patch)
tree249cc9b61ab0eccc5f239fda9e4b7c667aa5e037 /Source
parent4372a409222544a63c48997ddc6c8c16146ed6d9 (diff)
downloadCMake-82b3ed83d4cef6105afe4bee645e61991836509e.zip
CMake-82b3ed83d4cef6105afe4bee645e61991836509e.tar.gz
CMake-82b3ed83d4cef6105afe4bee645e61991836509e.tar.bz2
handle tildas
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSystemTools.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 903e31c..c896ca8 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -486,6 +486,16 @@ const char *cmSystemTools::ConvertToUnixSlashes(std::string& path)
{
path = path.substr(0, path.size()-1);
}
+
+ // if there is a tilda ~ then replace it with HOME
+ if(path.find("~") == 0)
+ {
+ if (getenv("HOME"))
+ {
+ path = std::string(getenv("HOME")) + path.substr(1);
+ }
+ }
+
// if there is a /tmp_mnt in a path get rid of it!
// stupid sgi's
if(path.find("/tmp_mnt") == 0)