diff options
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index abec7b9dd22..3e0a4f5aab9 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -98,8 +98,11 @@ namespace { size_t pos = str.find_last_of(separators, str.size() - 1); #ifdef LLVM_ON_WIN32 - if (pos == StringRef::npos) - pos = str.find_last_of(':', str.size() - 2); + if (pos == StringRef::npos) { + // Skip the drive letter, if one exists. + if (str.size() >= 2 && str[1] == ':') + pos = 2; + } #endif if (pos == StringRef::npos || |