From 50489ff6ff9c1ac7a329147823d1c15a231bdbd3 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Fri, 12 Jan 2007 16:47:23 -0500 Subject: [PATCH] ENH: Handle "~" in SplitPath. --- Source/kwsys/SystemTools.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 61cca36ce..5ffd032d7 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 home_components; + SystemTools::SplitPath(homepath, home_components); + components.insert(components.end(), + home_components.begin(), + home_components.end()); + } + c += 1; + } else { // Relative path.