Attempt to re-enable the VFS unittests on Windows

Using a //net/ path to hopefully avoid problems with non-absolute paths
on Windows.

llvm-svn: 203010
This commit is contained in:
Ben Langmuir
2014-03-05 21:32:20 +00:00
parent 026fc5f6ab
commit 9385323747
2 changed files with 76 additions and 74 deletions

View File

@@ -582,9 +582,11 @@ class VFSFromYAMLParser {
return NULL;
}
// Remove trailing slash(es)
// Remove trailing slash(es), being careful not to remove the root path
StringRef Trimmed(Name);
while (Trimmed.size() > 1 && sys::path::is_separator(Trimmed.back()))
size_t RootPathLen = sys::path::root_path(Trimmed).size();
while (Trimmed.size() > RootPathLen &&
sys::path::is_separator(Trimmed.back()))
Trimmed = Trimmed.slice(0, Trimmed.size()-1);
// Get the last component
StringRef LastComponent = sys::path::filename(Trimmed);