TextInputStream: don't strip

Let the caller decide whether to strip.  Only remove \n and \r
(end-of-line markers).
This commit is contained in:
Max Kellermann
2014-08-07 16:45:43 +02:00
parent 67958f7fa7
commit 1ca8d7ad45
3 changed files with 8 additions and 6 deletions

View File

@@ -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;

View File

@@ -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);