From 900ce3a2a445aa4b51efb1873aec0cf31aad3bb1 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Fri, 13 Jun 2014 14:52:55 +0200 Subject: [PATCH] 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 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()); -- 2.20.1