]> granicus.if.org Git - clang/commitdiff
improve path handling, patch by Baptiste Lepilleur!
authorChris Lattner <sabre@nondot.org>
Wed, 12 Aug 2009 17:50:39 +0000 (17:50 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 12 Aug 2009 17:50:39 +0000 (17:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78824 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/FileManager.cpp

index cc25d3305158620ef863bed31049d73284c6f616..98979d56cf0da75ee74b223923195e31ae41cd78 100644 (file)
@@ -221,6 +221,9 @@ const FileEntry *FileManager::getFile(const char *NameStart,
   const char *SlashPos = NameEnd-1;
   while (SlashPos >= NameStart && !IS_DIR_SEPARATOR_CHAR(SlashPos[0]))
     --SlashPos;
+  // Ignore duplicate //'s.
+  while (SlashPos > NameStart && IS_DIR_SEPARATOR_CHAR(SlashPos[-1]))
+    --SlashPos;
   
   const DirectoryEntry *DirInfo;
   if (SlashPos < NameStart) {