From e0aa72c32d9547dde558c6f5cbac32a377feb9da Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 9 Jun 2022 13:08:25 +0200 Subject: [PATCH] QSettings: Fix reading of the [%General] section The currentSection key was accidentally using the whole remaining section contents. Change-Id: Iec6e38636e519170eef136401ede4b626e12754a Reviewed-by: Qt CI Bot Reviewed-by: Edward Welbourne (cherry picked from commit 903a883044165b8f40f500684c437f4102031425) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 7e5d40108d5..aa4197bfef3 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1631,7 +1631,7 @@ bool QConfFileSettingsPrivate::readIniFile(QByteArrayView data, currentSection.clear(); } else { if (iniSection.compare("%general", Qt::CaseInsensitive) == 0) { - currentSection = QLatin1StringView(iniSection.constData() + 1); + currentSection = QLatin1StringView(iniSection.constData() + 1, iniSection.size() - 1); } else { currentSection.clear(); iniUnescapedKey(iniSection, currentSection);