[PathV2] Fix bug in relative_path.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Wed, 29 Feb 2012 00:06:24 +0000 (00:06 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Wed, 29 Feb 2012 00:06:24 +0000 (00:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151675 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/PathV2.cpp

index 3ef13e253f0ddc56e23887ff56aee11075144798..bf8672bc57bcf4b745dc56d7f631da04746c689e 100644 (file)
@@ -346,7 +346,7 @@ const StringRef root_directory(StringRef path) {
 
 const StringRef relative_path(StringRef path) {
   StringRef root = root_path(path);
-  return root.substr(root.size());
+  return path.substr(root.size());
 }
 
 void append(SmallVectorImpl<char> &path, const Twine &a,