mirror of https://github.com/snes9xgit/snes9x.git
Check for CR in correct string.
This commit is contained in:
parent
4207ddc9d2
commit
8c24f6d49f
|
@ -64,15 +64,15 @@ std::vector<std::string> read_file_lines(const char *filename)
|
||||||
std::string string_contents(file_contents);
|
std::string string_contents(file_contents);
|
||||||
delete[] file_contents;
|
delete[] file_contents;
|
||||||
|
|
||||||
std::istringstream ss(string_contents);
|
for (char &c : string_contents)
|
||||||
std::string line;
|
|
||||||
|
|
||||||
for (char &c : line)
|
|
||||||
{
|
{
|
||||||
if (c == '\r')
|
if (c == '\r')
|
||||||
c = '\n';
|
c = '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::istringstream ss(string_contents);
|
||||||
|
std::string line;
|
||||||
|
|
||||||
while (std::getline(ss, line, '\n'))
|
while (std::getline(ss, line, '\n'))
|
||||||
if (!line.empty())
|
if (!line.empty())
|
||||||
lines.push_back(line);
|
lines.push_back(line);
|
||||||
|
|
Loading…
Reference in New Issue