]> git.ipfire.org Git - thirdparty/util-linux.git/commit
col: fix output when first line does not have newline character
authorSami Kerola <kerolasa@iki.fi>
Sat, 20 Jun 2020 08:22:24 +0000 (09:22 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 20 Jun 2020 21:17:30 +0000 (22:17 +0100)
commitd8bfcb4cc5d65239e7c21b1067b82a0b24ae386b
tree9b002551f125e09e0c73efc996c3186a31a63f6f
parent883d1d65649e97877f4043e103c92d4271c280f2
col: fix output when first line does not have newline character

Commit I made while back and has been part of util-linux v2.30 to v2.35 made
col(1) not to output anything when first line did not have newline character.

    printf "gone from output" | col

This commit fixes the issue.  Admittedly the col source code is unnecessarily
hard to work with.  It could be a good idea to refactor the col(1) as low
priority task, Assuming refactoring is done the first commit to get that done
should add tests that exhaust all possible input handling including all command
line option directives.

Addresses: https://github.com/karelzak/util-linux/issues/422
Fixes: b6b5272b03ea9d3fa15601801d4d0f76ea4440f1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests/expected/col/newlines [new file with mode: 0644]
tests/ts/col/newlines [new file with mode: 0755]
text-utils/col.c