When the input to csplit contains fewer lines than the number of matches
specified, extra output was mistakenly included in some output files.
Fix the bug and add a simple ATF regression test.
PR: 219024
Submitted by: J.R. Oldroyd <fbsd at opal.com>
As of r295638, fputs() returns the number of bytes written (if not more than
INT_MAX). This broke csplit completely, since csplit assumed only success
only for the return value 0.
PR: 213510
Submitted by: J.R. Oldroyd
MFC after: 1 week
Relnotes: yes
When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard
Obtained from: NetBSD