aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input/TextInputStream.cxx6
-rw-r--r--src/playlist/plugins/ExtM3uPlaylistPlugin.cxx4
-rw-r--r--src/playlist/plugins/M3uPlaylistPlugin.cxx4
3 files changed, 8 insertions, 6 deletions
diff --git a/src/input/TextInputStream.cxx b/src/input/TextInputStream.cxx
index 0eb5bc1a8..1c46c2f2c 100644
--- a/src/input/TextInputStream.cxx
+++ b/src/input/TextInputStream.cxx
@@ -20,7 +20,6 @@
#include "config.h"
#include "TextInputStream.hxx"
#include "InputStream.hxx"
-#include "util/StringUtil.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
@@ -37,8 +36,9 @@ TextInputStream::ReadBufferedLine()
buffer.Consume(newline + 1 - r.data);
- char *end = StripRight(r.data, newline);
- *end = 0;
+ if (newline > r.data && newline[-1] == '\r')
+ --newline;
+ *newline = 0;
return r.data;
}
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);