New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix line ending bug for downloaded gecko codes #2539
Fix line ending bug for downloaded gecko codes #2539
Conversation
LGTM |
@@ -192,6 +192,9 @@ void CodeConfigPanel::DownloadCodes(wxCommandEvent&) | |||
|
|||
while ((std::getline(ss, line).good())) | |||
{ | |||
// Remove \r at the end of the line for files using windows line endings, std::getline only removes \n | |||
line = StripSpaces(line); | |||
|
|||
// empty line | |||
if (0 == line.size() || line == "\r" || line == "\n") // \r\n checks might not be needed |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
1a7c632
to
e686bfe
Compare
// empty line | ||
if (0 == line.size() || line == "\r" || line == "\n") // \r\n checks might not be needed | ||
if (0 == line.size()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Updated: Removed the unnecessary check for lines consisting only of \r, which can't happen anymore. |
e686bfe
to
bd5e55b
Compare
@dolphin-emu-bot rebuild |
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
LGTM |
Fix line ending bug for downloaded gecko codes
Gecko codes .txt files that contain windows style line endings result in mixed line endings for the generated .ini file(\r\r\n) when using Windows. This PR removes some single \r at the end of lines. The generated file uses the line ending style from the running OS, so in case of Windows, it's generating files with \r\n line endings.
Tested on Windows, some confirmation that this generates proper unix line endings on linux would be nice. Test example was Wii Sports Resort PAL.