diff options
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/TextInputStream.cxx | 7 | ||||
-rw-r--r-- | src/input/plugins/CurlInputPlugin.cxx | 9 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/input/TextInputStream.cxx b/src/input/TextInputStream.cxx index 36aa5f408..177606d6d 100644 --- a/src/input/TextInputStream.cxx +++ b/src/input/TextInputStream.cxx @@ -20,7 +20,7 @@ #include "config.h" #include "TextInputStream.hxx" #include "InputStream.hxx" -#include "util/CharUtil.hxx" +#include "util/StringUtil.hxx" #include "util/Error.hxx" #include "Log.hxx" @@ -72,8 +72,7 @@ TextInputStream::ReadLine() buffer.Consume(p - src + 1); - while (p > src && IsWhitespaceFast(p[-1])) - --p; - *p = 0; + char *end = StripRight(src, p); + *end = 0; return src; } diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 4d7671cc2..a174fcca6 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -31,7 +31,7 @@ #include "event/Call.hxx" #include "IOThread.hxx" #include "util/ASCII.hxx" -#include "util/CharUtil.hxx" +#include "util/StringUtil.hxx" #include "util/NumberParser.hxx" #include "util/CircularBuffer.hxx" #include "util/HugeAllocator.hxx" @@ -661,11 +661,8 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream) /* strip the value */ - while (value < end && IsWhitespaceOrNull(*value)) - ++value; - - while (end > value && IsWhitespaceOrNull(end[-1])) - --end; + value = StripLeft(value, end); + end = StripRight(value, end); c.HeaderReceived(name, std::string(value, end)); return size; |