Merge pull request #4183 from markwkidd/patch-3

accept playlists with Unix and Windows style line endings
This commit is contained in:
Alcaro 2016-12-14 21:48:20 +01:00 committed by GitHub
commit fd9e721f97

View File

@ -463,9 +463,13 @@ static bool playlist_read_file(
if (!filestream_gets(file, buf[i], sizeof(buf[i]))) if (!filestream_gets(file, buf[i], sizeof(buf[i])))
goto end; goto end;
last = strrchr(buf[i], '\n'); /* Read playlist entry and terminate string with NUL character
if (last) * regardless of Windows or Unix line endings
*last = '\0'; */
if((last = strrchr(buf[i], '\r')))
*last = '\0';
else if((last = strrchr(buf[i], '\n')))
*last = '\0';
} }
entry = &playlist->entries[playlist->size]; entry = &playlist->entries[playlist->size];