mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 01:16:05 +00:00
Revert r132539 for now, "My testing shows that function stat has no problem with trailing separators. (tested on Windows and Darwin)."
It caused PR10331. MSVCRT stat() cannot strip trailing '/'. (can '\') llvm-svn: 144884
This commit is contained in:
parent
0f65d59e52
commit
32f1acf14a
@ -265,6 +265,12 @@ void FileManager::addAncestorsAsVirtualDirs(StringRef Path) {
|
||||
///
|
||||
const DirectoryEntry *FileManager::getDirectory(StringRef DirName,
|
||||
bool CacheFailure) {
|
||||
// stat doesn't like trailing separators.
|
||||
// At least, on Win32 MSVCRT, stat() cannot strip trailing '/'.
|
||||
// (though it can strip '\\')
|
||||
if (DirName.size() > 1 && llvm::sys::path::is_separator(DirName.back()))
|
||||
DirName = DirName.substr(0, DirName.size()-1);
|
||||
|
||||
++NumDirLookups;
|
||||
llvm::StringMapEntry<DirectoryEntry *> &NamedDirEnt =
|
||||
SeenDirEntries.GetOrCreateValue(DirName);
|
||||
|
Loading…
x
Reference in New Issue
Block a user