From b2eee7d31624cc32a20f01d5b8a612c675f79564 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Fri, 13 Jun 2014 14:52:55 +0200 Subject: [PATCH 1/1] 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 --- src/core/corenetwork.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index b7d496af..80986f06 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()); -- 2.20.1