Core: Fix virtual disc index reading.

Otherwise it thought the newline was part of the path.
This commit is contained in:
Unknown W. Brackets
2021-05-09 16:05:41 -07:00
parent df8e80d4fb
commit fada6583c9

View File

@@ -92,6 +92,9 @@ void VirtualDiscFileSystem::LoadFileListIndex() {
char linebuf[MAX_LINE_SIZE]{};
while (fgets(linebuf, MAX_LINE_SIZE, f)) {
std::string line = linebuf;
// Strip newline from fgets.
if (!line.empty() && line.back() == '\n')
line.resize(line.size() - 1);
// Ignore any UTF-8 BOM.
if (line.substr(0, 3) == "\xEF\xBB\xBF") {