summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-08-16 13:04:13 (GMT)
committerBrad King <brad.king@kitware.com>2010-08-16 13:10:03 (GMT)
commit0a21abd690948b1b964cf6055534b24b7e1139f9 (patch)
tree6c5bad37fdfac61e7cd41e51e77f18c7d9d05561
parent78474d9f24876a88972d06c92a96d600335e354a (diff)
downloadCMake-0a21abd690948b1b964cf6055534b24b7e1139f9.zip
CMake-0a21abd690948b1b964cf6055534b24b7e1139f9.tar.gz
CMake-0a21abd690948b1b964cf6055534b24b7e1139f9.tar.bz2
KWSys: Fix SplitPath for leading '\' on Windows
Windows paths may begin with a single backslash when the drive letter is omitted. Recognize this as a root path component.
-rw-r--r--Source/kwsys/SystemTools.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 3153235..1f3b5af 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -3143,9 +3143,9 @@ const char* SystemTools::SplitPathRootComponent(const char* p,
}
c += 2;
}
- else if(c[0] == '/')
+ else if(c[0] == '/' || c[0] == '\\')
{
- // Unix path.
+ // Unix path (or Windows path w/out drive letter).
if(root)
{
*root = "/";