Fix symbols name from maps taking 2 lines instead of one

Symbols map may not only end with a \n, but they may also end with \r\n and only the \n would get removed.  This is the case with the Super Mario Sunshine map file which resulted in a weird looking symbols list and thus made it harder to scroll through it.  This removes the \r after the \n has been removed if it's present.
This commit is contained in:
aldelaro5 2017-02-07 09:56:19 -05:00
parent bdf09c7d3b
commit 9dc9033b76
1 changed files with 2 additions and 0 deletions

View File

@ -356,6 +356,8 @@ bool PPCSymbolDB::LoadMap(const std::string& filename, bool bad)
if (namepos != nullptr) // would be odd if not :P
strcpy(name, namepos);
name[strlen(name) - 1] = 0;
if (name[strlen(name) - 1] == '\r')
name[strlen(name) - 1] = 0;
// Check if this is a valid entry.
if (strcmp(name, ".text") != 0 && strcmp(name, ".init") != 0 && strlen(name) > 0)