aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
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/input
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/input')
-rw-r--r--src/input/TextInputStream.cxx6
1 files changed, 3 insertions, 3 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;
}