aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist/plugins
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-07 16:45:43 +0200
committerMax Kellermann <max@duempel.org>2014-08-07 16:45:43 +0200
commit1ca8d7ad4527b228a4f2f25409ce5e939a14141c (patch)
tree97a9caf4213699a2acf4dbdcffa60a1d0409c80b /src/playlist/plugins
parent67958f7fa7ae0d9b91fcd6025cda6c6abbecd6da (diff)
downloadmpd-1ca8d7ad4527b228a4f2f25409ce5e939a14141c.tar.gz
mpd-1ca8d7ad4527b228a4f2f25409ce5e939a14141c.tar.xz
mpd-1ca8d7ad4527b228a4f2f25409ce5e939a14141c.zip
TextInputStream: don't strip
Let the caller decide whether to strip. Only remove \n and \r (end-of-line markers).
Diffstat (limited to 'src/playlist/plugins')
-rw-r--r--src/playlist/plugins/ExtM3uPlaylistPlugin.cxx4
-rw-r--r--src/playlist/plugins/M3uPlaylistPlugin.cxx4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/playlist/plugins/ExtM3uPlaylistPlugin.cxx b/src/playlist/plugins/ExtM3uPlaylistPlugin.cxx
index 9d277ec3f..15e8125e3 100644
--- a/src/playlist/plugins/ExtM3uPlaylistPlugin.cxx
+++ b/src/playlist/plugins/ExtM3uPlaylistPlugin.cxx
@@ -104,13 +104,15 @@ DetachedSong *
ExtM3uPlaylist::NextSong()
{
Tag tag;
- const char *line_s;
+ char *line_s;
do {
line_s = tis.ReadLine();
if (line_s == nullptr)
return nullptr;
+ StripRight(line_s);
+
if (StringStartsWith(line_s, "#EXTINF:")) {
tag = extm3u_parse_tag(line_s + 8);
continue;
diff --git a/src/playlist/plugins/M3uPlaylistPlugin.cxx b/src/playlist/plugins/M3uPlaylistPlugin.cxx
index 977587377..a4125bc70 100644
--- a/src/playlist/plugins/M3uPlaylistPlugin.cxx
+++ b/src/playlist/plugins/M3uPlaylistPlugin.cxx
@@ -45,14 +45,14 @@ m3u_open_stream(InputStream &is)
DetachedSong *
M3uPlaylist::NextSong()
{
- const char *line_s;
+ char *line_s;
do {
line_s = tis.ReadLine();
if (line_s == nullptr)
return nullptr;
- line_s = StripLeft(line_s);
+ line_s = Strip(line_s);
} while (line_s[0] == '#' || *line_s == 0);
return new DetachedSong(line_s);