QSettings: Fix reading of the [%General] section

The currentSection key was accidentally using the whole remaining
section contents.

Pick-to: 6.4
Change-Id: Iec6e38636e519170eef136401ede4b626e12754a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
hjk 2022-06-09 13:08:25 +02:00
parent 4912903e37
commit 903a883044

View File

@ -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);