COFF: Handle both / and \ as path separator.
llvm-svn: 240042
This commit is contained in:
parent
4bde6c2674
commit
ea63a28364
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue