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.
This commit is contained in:
Brad King 2010-08-16 09:04:13 -04:00
parent 78474d9f24
commit 0a21abd690
1 changed files with 2 additions and 2 deletions

View File

@ -3143,9 +3143,9 @@ const char* SystemTools::SplitPathRootComponent(const char* p,
} }
c += 2; 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) if(root)
{ {
*root = "/"; *root = "/";