summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsourceprocessor.cpp
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-02-23 10:10:49 +0100
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-02-23 13:09:20 +0000
commitb276de576fd383905869d65068827d3c4781acba (patch)
treea04e1fa5634b5bc60c4346ae098d3fbcacffa5fe /src/plugins/cpptools/cppsourceprocessor.cpp
parentbde42d755fcc15afc0fb914c4fe40b5ee6e7d1fd (diff)
downloadqt-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.cpp1
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;
}