From 4223d739e95e19595f62238006a7549be19068f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 22 Mar 2022 13:26:31 +0100 Subject: [PATCH] Use empty d->cString for TQString::shared_null instead of null string. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This restores consistency for the behavior of methods TQString::utf8() and TQString::local8Bit() with null TQStrings. Signed-off-by: Slávek Banko (cherry picked from commit e99bbda7347d35833da0876bc745d5e0b6c18c2b) --- src/tools/qstring.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index 483efb9..795953a 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -5725,7 +5725,7 @@ const char* QString::ascii() const QCString QString::utf8() const { if (!d->cString) { - d->cString = new QCString; + d->cString = new QCString(""); } if(d == shared_null) { @@ -5974,7 +5974,7 @@ QString QString::fromLatin1( const char* chars, int len ) QCString QString::local8Bit() const { if (!d->cString) { - d->cString = new QCString; + d->cString = new QCString(""); } if(d == shared_null) {