Commit eab1a776 authored by Max Kellermann's avatar Max Kellermann

ClientRead: always ignore whitespace at the end of the line

parent 84f5e0c0
ver 0.18.1 (2013/11/??) ver 0.18.1 (2013/11/??)
* protocol:
- always ignore whitespace at the end of the line
* filter: * filter:
- autoconvert: fix "volume_normalization" with mp3 files - autoconvert: fix "volume_normalization" with mp3 files
* add missing files to source tarball * add missing files to source tarball
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "ClientInternal.hxx" #include "ClientInternal.hxx"
#include "Main.hxx" #include "Main.hxx"
#include "event/Loop.hxx" #include "event/Loop.hxx"
#include "util/CharUtil.hxx"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
...@@ -35,11 +36,15 @@ Client::OnSocketInput(void *data, size_t length) ...@@ -35,11 +36,15 @@ Client::OnSocketInput(void *data, size_t length)
TimeoutMonitor::ScheduleSeconds(client_timeout); TimeoutMonitor::ScheduleSeconds(client_timeout);
BufferedSocket::ConsumeInput(newline + 1 - p);
/* skip whitespace at the end of the line */
while (newline > p && IsWhitespaceOrNull(newline[-1]))
--newline;
/* terminate the string at the end of the line */ /* terminate the string at the end of the line */
*newline = 0; *newline = 0;
BufferedSocket::ConsumeInput(newline + 1 - p);
CommandResult result = client_process_line(*this, p); CommandResult result = client_process_line(*this, p);
switch (result) { switch (result) {
case CommandResult::OK: case CommandResult::OK:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment