diff options
author | Ben Langmuir <blangmuir@apple.com> | 2014-03-05 21:32:20 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2014-03-05 21:32:20 +0000 |
commit | 9385323747f99da43f2cd34b85142f4a065cebff (patch) | |
tree | c6717b9b77e0a52717392b891998233d0db09d1a /clang/lib/Basic/VirtualFileSystem.cpp | |
parent | 026fc5f6ab05cfd4183cb163a2544545121e71d8 (diff) | |
download | llvm-9385323747f99da43f2cd34b85142f4a065cebff.zip llvm-9385323747f99da43f2cd34b85142f4a065cebff.tar.gz llvm-9385323747f99da43f2cd34b85142f4a065cebff.tar.bz2 |
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
Diffstat (limited to 'clang/lib/Basic/VirtualFileSystem.cpp')
-rw-r--r-- | clang/lib/Basic/VirtualFileSystem.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Basic/VirtualFileSystem.cpp b/clang/lib/Basic/VirtualFileSystem.cpp index dc0f52f..28bb598 100644 --- a/clang/lib/Basic/VirtualFileSystem.cpp +++ b/clang/lib/Basic/VirtualFileSystem.cpp @@ -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); |