diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-12-05 15:03:30 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-12-06 11:39:19 +0000 |
commit | 83c3b2cad0d9387d4918dae970693bda7aa54966 (patch) | |
tree | 66caad3553ccfbe2b487715c6405a8bf1c9fe0c2 /src | |
parent | a78974f95b1e4851728b8f6a47715022f11f9059 (diff) |
Fix handling of a double backslash at the end of line
The double backslash at EOL shall not be altered.
Task-number: QTCREATORBUG-20550
Change-Id: Ib4cc73da7a6634233d222945f01dd7974d112971
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/jomlib/makefilelinereader.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jomlib/makefilelinereader.cpp b/src/jomlib/makefilelinereader.cpp index 60a1cbf..ee20d86 100644 --- a/src/jomlib/makefilelinereader.cpp +++ b/src/jomlib/makefilelinereader.cpp @@ -139,6 +139,8 @@ MakefileLine MakefileLineReader::readLine_impl_local8bit() if (bufLength >= 3 && buf[bufLength - 3] == '^') { buf[bufLength - 3] = '\\'; // replace "^\\\n" -> "\\\\\n" bufLength -= 2; // remove "\\\n" + } else if (bufLength >= 3 && buf[bufLength - 3] == '\\') { + bufLength--; // remove trailing \n } else { bufLength -= 2; // remove "\\\n" line.continuation = LineContinuationType::Backslash; @@ -172,6 +174,8 @@ MakefileLine MakefileLineReader::readLine_impl_unicode() if (str.endsWith(QLatin1String("^\\"))) { str.remove(str.length() - 2, 1); + } else if (str.endsWith(QLatin1String("\\\\"))) { + // Do nothing. Double backslash at the end is not altered. } else if (str.endsWith(QLatin1Char('\\'))) { str.chop(1); line.continuation = LineContinuationType::Backslash; |