diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2007-01-12 21:47:23 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2007-01-12 21:47:23 (GMT) |
commit | 50489ff6ff9c1ac7a329147823d1c15a231bdbd3 (patch) | |
tree | 2f490e2ad7cbb94edeadea579aa1aa84dd91a9b0 /Source/kwsys/SystemTools.cxx | |
parent | cca67d7f8eec353a4dd46ee021090af1f6cf546f (diff) | |
download | CMake-50489ff6ff9c1ac7a329147823d1c15a231bdbd3.zip CMake-50489ff6ff9c1ac7a329147823d1c15a231bdbd3.tar.gz CMake-50489ff6ff9c1ac7a329147823d1c15a231bdbd3.tar.bz2 |
ENH: Handle "~" in SplitPath.
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 61cca36..5ffd032 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2829,6 +2829,19 @@ void SystemTools::SplitPath(const char* p, components.push_back(root); c += 2; } + else if(c[0] == '~') + { + const char* homepath = getenv("HOME"); + if(homepath) + { + kwsys_stl::vector<kwsys_stl::string> home_components; + SystemTools::SplitPath(homepath, home_components); + components.insert(components.end(), + home_components.begin(), + home_components.end()); + } + c += 1; + } else { // Relative path. |