fileio: make read_line() handle various line endings correctly

System Internals / systemd - Lennart Poettering [poettering.net] - 14 December 2018 08:12 EST

This adds support for windows line endings.

More importantly though with this change a newline followed by EOF is considered a single line end.

838894b0c fileio: make read_line() handle various line endings correctly
src/basic/fileio.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++----
src/test/test-fileio.c | 33 +++++++++++++++++++++++++----
2 files changed, 81 insertions(+), 8 deletions(-)

Upstream: github.com


  • Share