From fec618b723978f481de30db3e71bb20b9a476c5c Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 24 May 2023 16:27:46 +0200 Subject: [PATCH] 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 Reviewed-by: Joerg Bornemann --- src/tools/syncqt/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/syncqt/main.cpp b/src/tools/syncqt/main.cpp index 3255c6ad9a..dbb3d30aaa 100644 --- a/src/tools/syncqt/main.cpp +++ b/src/tools/syncqt/main.cpp @@ -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()) {