Utils: Fix splitting in ChannelBuffer::takeFirstLine()

Escape the '\r'

Change-Id: I8cee40dc4a65f893f1a11c7cf066777498c37339
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2021-06-09 01:00:19 +02:00
parent b820a832b2
commit 27f8e2dbce
2 changed files with 37 additions and 1 deletions

View File

@@ -875,7 +875,7 @@ QString ChannelBuffer::linesRead()
// Check for first complete line inside the rawData and return it, removing the line from the buffer
Utils::optional<QString> ChannelBuffer::takeFirstLine()
{
const int firstLineEnd = qMax(rawData.indexOf('\n'), rawData.indexOf('r'));
const int firstLineEnd = qMax(rawData.indexOf('\n'), rawData.indexOf('\r'));
if (firstLineEnd == -1)
return Utils::nullopt;