diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-02-23 10:10:49 +0100 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-02-23 13:09:20 +0000 |
commit | b276de576fd383905869d65068827d3c4781acba (patch) | |
tree | a04e1fa5634b5bc60c4346ae098d3fbcacffa5fe /src/plugins/cpptools/cppsourceprocessor.cpp | |
parent | bde42d755fcc15afc0fb914c4fe40b5ee6e7d1fd (diff) | |
download | qt-creator-b276de576fd383905869d65068827d3c4781acba.tar.gz |
CppTools: Replace "\r\n" with "\n" in cpp file content
When we get the file working copy it never contains "\r\n"
line endings. Let's provide the same behavior when we have
no working copy and read the file from disk.
Task-number: QTCREATORBUG-19905
Change-Id: I720d62426860dcdcdd8520db5430d9f4f5900ab6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp')
-rw-r--r-- | src/plugins/cpptools/cppsourceprocessor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp index 507e33c90b..5cff8d8fb2 100644 --- a/src/plugins/cpptools/cppsourceprocessor.cpp +++ b/src/plugins/cpptools/cppsourceprocessor.cpp @@ -228,6 +228,7 @@ bool CppSourceProcessor::getFileContents(const QString &absoluteFilePath, qPrintable(error)); return false; } + contents->replace("\r\n", "\n"); return true; } |