mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Merge pull request #4183 from markwkidd/patch-3
accept playlists with Unix and Windows style line endings
This commit is contained in:
commit
fd9e721f97
@ -463,8 +463,12 @@ static bool playlist_read_file(
|
||||
if (!filestream_gets(file, buf[i], sizeof(buf[i])))
|
||||
goto end;
|
||||
|
||||
last = strrchr(buf[i], '\n');
|
||||
if (last)
|
||||
/* Read playlist entry and terminate string with NUL character
|
||||
* regardless of Windows or Unix line endings
|
||||
*/
|
||||
if((last = strrchr(buf[i], '\r')))
|
||||
*last = '\0';
|
||||
else if((last = strrchr(buf[i], '\n')))
|
||||
*last = '\0';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user