From: Sebastian Meyer Date: Fri, 13 Jun 2014 12:52:55 +0000 (+0200) Subject: Checking for single char line endings X-Git-Tag: 0.10.1~19 X-Git-Url: https://git.quassel-irc.org/?a=commitdiff_plain;h=900ce3a2a445aa4b51efb1873aec0cf31aad3bb1;p=quassel.git Checking for single char line endings This fixes problems with IRC servers sending only single char line endings. Before the last char on each line for thos servers would be chopped, now Quassel checks how the line ends and chops accordingly. Fixes #1267 --- diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 18f27842..d57cacaa 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -411,7 +411,10 @@ void CoreNetwork::socketHasData() { while (socket.canReadLine()) { QByteArray s = socket.readLine(); - s.chop(2); + if (s.endsWith("\r\n")) + s.chop(2); + else if (s.endsWith("\n")) + s.chop(1); NetworkDataEvent *event = new NetworkDataEvent(EventManager::NetworkIncoming, this, s); #if QT_VERSION >= 0x040700 event->setTimestamp(QDateTime::currentDateTimeUtc());