From aec367ef2804c74f4ef5d5d647c43b7e65e12f67 Mon Sep 17 00:00:00 2001
From: Slávek Banko <slavek.banko@axis.cz>
Date: Tue, 22 Mar 2022 13:26:31 +0100
Subject: 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 <slavek.banko@axis.cz>
---
 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 59f8e1423..27bdf31d8 100644
--- a/src/tools/qstring.cpp
+++ b/src/tools/qstring.cpp
@@ -6000,7 +6000,7 @@ void TQString::setSecurityUnPaged(bool lock) {
 TQCString TQString::utf8() const
 {
     if (!d->cString) {
-        d->cString = new TQCString;
+        d->cString = new TQCString("");
     }
     if(d == shared_null)
     {
@@ -6254,7 +6254,7 @@ TQString TQString::fromLatin1( const char* chars, int len )
 TQCString TQString::local8Bit() const
 {
     if (!d->cString) {
-        d->cString = new TQCString;
+        d->cString = new TQCString("");
     }
     if(d == shared_null)
     {
-- 
cgit v1.2.3

