Details
Description
after a line containing a comment, the next line's leading whitespace is not removed.
bug is in qtbase\src\corelib\io\qsettings.cpp, function readIniLine.
comment is consumed at line 1626 of qsettings.cpp (5.9.0):
while (i < dataLen && (((ch = data.at) != '\n') && ch != '\r'))
but whitespace is only consumed at the start of the function.
Minimum example to reproduce:
#include <QSettings> int main(int argc, char *argv[]) { QSettings ini("test.ini", QSettings::IniFormat); ini.beginGroup("FOO"); bool ok; ini.value("bar").toInt(&ok); Q_ASSERT(ok); }
working test.ini file:
[FOO] ;bar = 1 bar = 2
non-working:
[FOO] ;bar = 1 bar = 2