]> git.ipfire.org Git - thirdparty/ccache.git/commit
fix: Do not add redundant newlines for stdout 1037/head
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>
Fri, 25 Mar 2022 14:27:39 +0000 (17:27 +0300)
committerOrgad Shaneh <orgad.shaneh@audiocodes.com>
Tue, 5 Apr 2022 07:22:38 +0000 (10:22 +0300)
commitff10b34851050a24fa7a13fa08064010c37bcd78
treeac4376b317e97eaa0043b78ed2f790fe88ec1ee9
parenta5b5c5acacb4c0f610569f39a7d97f80535e56b2
fix: Do not add redundant newlines for stdout

Tokenizer is used with include_empty, and the output typically ends with
\n.

For each line, tokenizer returns it without the \n, and the function
appends
it. But if the output ends with \n, the tokenizer returns an additional
empty string, and a redundant LF is written to stdout.

Another issue can be if the last line of the original output doesn't end
with \n at all, ccache added it anyway.

It was probably unnoticed until now since gcc has no output at all, while
cl outputs the source file name.
src/ccache.cpp