diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp index b0a13fbd8147..6d084bb24739 100644 --- a/lld/COFF/InputFiles.cpp +++ b/lld/COFF/InputFiles.cpp @@ -32,7 +32,7 @@ namespace coff { // Returns the last element of a path, which is supposed to be a filename. static StringRef getBasename(StringRef Path) { - size_t Pos = Path.rfind('\\'); + size_t Pos = Path.find_last_of("\\/"); if (Pos == StringRef::npos) return Path; return Path.substr(Pos + 1);