summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-03-29 13:09:47 (GMT)
committerBrad King <brad.king@kitware.com>2005-03-29 13:09:47 (GMT)
commitc7a2c80c178457b4d8a1525a6b0ccff9ca4e5afa (patch)
tree789bfeb767697d8cb405537aaf539853d0dc0060 /Source/kwsys/SystemTools.cxx
parent571929e86c6ce285cb16814ff5e0513e838ffc99 (diff)
downloadCMake-c7a2c80c178457b4d8a1525a6b0ccff9ca4e5afa.zip
CMake-c7a2c80c178457b4d8a1525a6b0ccff9ca4e5afa.tar.gz
CMake-c7a2c80c178457b4d8a1525a6b0ccff9ca4e5afa.tar.bz2
ENH: SplitPath now supports slashes in both directions in the input path but still produces forward slashes in the root component.
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 25676ee..c508e38 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2240,7 +2240,7 @@ void SystemTools::SplitPath(const char* p,
components.clear();
// Identify the root component.
const char* c = p;
- if(c[0] == '/' && c[1] == '/')
+ if((c[0] == '/' && c[1] == '/') || (c[0] == '\\' && c[1] == '\\'))
{
// Network path.
components.push_back("//");
@@ -2252,7 +2252,7 @@ void SystemTools::SplitPath(const char* p,
components.push_back("/");
c += 1;
}
- else if(c[0] && c[1] == ':' && c[2] == '/')
+ else if(c[0] && c[1] == ':' && (c[2] == '/' || c[2] == '\\'))
{
// Windows path.
kwsys_stl::string root = "_:/";
@@ -2279,7 +2279,7 @@ void SystemTools::SplitPath(const char* p,
const char* last = first;
for(;*last; ++last)
{
- if(*last == '/')
+ if(*last == '/' || *last == '\\')
{
// End of a component. Save it.
components.push_back(kwsys_stl::string(first, last-first));