From b276de576fd383905869d65068827d3c4781acba Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 23 Feb 2018 10:10:49 +0100 Subject: 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 Reviewed-by: Tobias Hunger --- src/plugins/cpptools/cppsourceprocessor.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp') 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; } -- cgit v1.2.1