From e7feed379f10d936b79b1e262a6bfbec72da781f Mon Sep 17 00:00:00 2001 From: Chih-Hsuan Yen Date: Thu, 2 Apr 2020 11:38:20 +0800 Subject: [PATCH] Fix QCharRef deprecated behavior (closes #323) Inspired by https://github.com/KDE/konsole/commit/324d78c07fc4fe2cdb2219a9e042a969df73d39c --- lib/Vt102Emulation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Vt102Emulation.cpp b/lib/Vt102Emulation.cpp index be97f1d..4754dfd 100644 --- a/lib/Vt102Emulation.cpp +++ b/lib/Vt102Emulation.cpp @@ -413,10 +413,10 @@ void Vt102Emulation::processWindowAttributeChange() return; } - QString newValue; - newValue.reserve(tokenBufferPos-i-2); - for (int j = 0; j < tokenBufferPos-i-2; j++) - newValue[j] = tokenBuffer[i+1+j]; + // copy from the first char after ';', and skipping the ending delimiter + // 0x07 or 0x92. Note that as control characters in OSC text parts are + // ignored, only the second char in ST ("\e\\") is appended to tokenBuffer. + QString newValue = QString::fromWCharArray(tokenBuffer + i + 1, tokenBufferPos-i-2); _pendingTitleUpdates[attributeToChange] = newValue; _titleUpdateTimer->start(20);