Closed StevenMaude closed 7 years ago
This seems to give consistent behaviour with GNU cat.
testfile
containing a line with a newline:
some text\n
$ ./cat testfile
some text
$
testfile
containing a line with no newline:
some text
$ ./cat
some text$
testfile
containing no characters at all:
(no characters)
$ ./cat testfile
$
There might be some other edge case I've not thought of, however, where my solution behaves differently to GNU cat.
Only break if there's no content to send to standard output.
Fixes #21.