mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
Change Path::filename_pos() to skip the drive letter.
For Windows, filename_pos() tries to find the filename by searching for separators after the last :. Instead, it should really check for the only location that a : is valid, which is in the second character, and search for separators after that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228874 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -98,8 +98,11 @@ namespace {
|
|||||||
size_t pos = str.find_last_of(separators, str.size() - 1);
|
size_t pos = str.find_last_of(separators, str.size() - 1);
|
||||||
|
|
||||||
#ifdef LLVM_ON_WIN32
|
#ifdef LLVM_ON_WIN32
|
||||||
if (pos == StringRef::npos)
|
if (pos == StringRef::npos) {
|
||||||
pos = str.find_last_of(':', str.size() - 2);
|
// Skip the drive letter, if one exists.
|
||||||
|
if (str.size() >= 2 && str[1] == ':')
|
||||||
|
pos = 2;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pos == StringRef::npos ||
|
if (pos == StringRef::npos ||
|
||||||
|
Reference in New Issue
Block a user