ENH: Handle "~" in SplitPath.

This commit is contained in:
Clinton Stimpson 2007-01-12 16:47:23 -05:00
parent cca67d7f8e
commit 50489ff6ff
1 changed files with 13 additions and 0 deletions

View File

@ -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.