From b067e10df08c08aae8d665358317740c379c8528 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 25 Oct 2011 10:34:11 +0200 Subject: [PATCH] fixed error generating wrong introspection string in header output file When using dbus introspection files with CRLF encoding the CR is not handled and results into a CR code at a wrong location in the output file QTBUG-17634 --- tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp b/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp index 602cdac..dc2b533 100644 --- a/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -466,11 +466,13 @@ static QString stringify(const QString &data) int i; for (i = 0; i < data.length(); ++i) { retval += QLatin1Char('\"'); - for ( ; i < data.length() && data[i] != QLatin1Char('\n'); ++i) + for ( ; i < data.length() && data[i] != QLatin1Char('\n') && data[i] != QLatin1Char('\r'); ++i) if (data[i] == QLatin1Char('\"')) retval += QLatin1String("\\\""); else retval += data[i]; + if (data[i] == QLatin1Char('\r') && data[i+1] == QLatin1Char('\n')) + i++; retval += QLatin1String("\\n\"\n"); } return retval; -- 1.7.4.msysgit.0