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