aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-12 17:50:39 +0000
committerChris Lattner <sabre@nondot.org>2009-08-12 17:50:39 +0000
commit46730b261c46765c51a9aa83c2571a2a8705482a (patch)
tree11f9af0a44f86e501c671e9a7ce1fec41f2375f5 /lib/Basic
parent4ffe91eae351d6ef68256ce77fc549557702d3e3 (diff)
improve path handling, patch by Baptiste Lepilleur!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r--lib/Basic/FileManager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp
index cc25d33051..98979d56cf 100644
--- a/lib/Basic/FileManager.cpp
+++ b/lib/Basic/FileManager.cpp
@@ -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) {