Ignore carriage return character symbol explicitly

If users prefer non-unix new line style when building Qt in Linux
'\r' leads to an issue. syncqt cannot parse Qt header files using
inputstream. Add the explicit ignorance of the carriage return
character to make sure that it won't break parsing of the Qt headers.

Pick-to: 6.5
Fixes: QTBUG-113771
Change-Id: Iac69e77788517fe160118297051597a656b2f345
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
bb10
Alexey Edelev 2023-05-24 16:27:46 +02:00
parent 47db21965d
commit fec618b723
1 changed files with 2 additions and 0 deletions

View File

@ -1102,6 +1102,8 @@ public:
// - start-end of class/structures
// And avoid processing of the the data inside these blocks.
for (std::size_t i = 0; i < line.size(); ++i) {
if (line[i] == '\r')
continue;
if (bracesDepth == namespaceCount) {
if (line[i] == '/') {
if ((i + 1) < line.size()) {