playlist/extm3u: strip first line for #EXTM3U detection

This commit is contained in:
Max Kellermann 2014-10-17 20:45:18 +02:00
parent bc840b69d5
commit a0fae8dacc
2 changed files with 8 additions and 2 deletions

2
NEWS
View File

@ -1,6 +1,8 @@
ver 0.19.1 (not yet released) ver 0.19.1 (not yet released)
* input * input
- mms: fix deadlock bug - mms: fix deadlock bug
* playlist
- extm3u: fix Extended M3U detection
* fix build failure on Mac OS X * fix build failure on Mac OS X
* add missing file systemd/mpd.socket to tarball * add missing file systemd/mpd.socket to tarball

View File

@ -39,8 +39,12 @@ public:
} }
bool CheckFirstLine() { bool CheckFirstLine() {
const char *line = tis.ReadLine(); char *line = tis.ReadLine();
return line != nullptr && strcmp(line, "#EXTM3U") == 0; if (line == nullptr)
return false;
StripRight(line);
return strcmp(line, "#EXTM3U") == 0;
} }
virtual DetachedSong *NextSong() override; virtual DetachedSong *NextSong() override;