diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2011-11-30 19:21:24 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-11-30 19:21:31 (GMT) |
commit | 70c1e9589bf390bc3010663f133d87a789f17c3e (patch) | |
tree | bf94a7e0cbe84fe1286cfa1249f0f1857bd69953 /tools/qdbus | |
parent | e4bdb5d8144f62d803f1d904275db91c155d3561 (diff) | |
download | Qt-70c1e9589bf390bc3010663f133d87a789f17c3e.zip Qt-70c1e9589bf390bc3010663f133d87a789f17c3e.tar.gz Qt-70c1e9589bf390bc3010663f133d87a789f17c3e.tar.bz2 |
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
Task-number: QTBUG-17634
Merge-request: 1478
Reviewed-by: thiago
Diffstat (limited to 'tools/qdbus')
-rw-r--r-- | 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 bc617a9..9c49183 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; |