Commit Graph

14 Commits

Author SHA1 Message Date
pfg
7551d83c35 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
cem
cbb9f3e660 csplit(1): Fix extraneous output in edge case
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>
2017-05-08 15:51:29 +00:00
jilles
2bdc6493a9 csplit: Fix check of fputs() return value, making csplit work again.
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
2017-05-02 21:56:20 +00:00
bapt
9af4744a94 Rename getline with get_line to avoid collision with getline(3)
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
2016-05-10 11:11:23 +00:00
ed
ce4cbee6a1 Add missing static keywords to csplit(1) 2011-11-06 08:14:45 +00:00
tjr
01944bbfc2 Use fseeko() to properly support large files. 2004-03-22 11:15:03 +00:00
tjr
a1bce5d548 Use errc(). 2004-03-22 09:33:10 +00:00
dwmalone
39f15130f8 The return value of snprintf should be always nonnegative, so it should
be safe to cast it to a size_t before comparing it to a sizeof().
2002-07-28 15:41:15 +00:00
tjr
32b632dfec Use sigaction(2) instead of signal(3) to avoid the signal handler being
re-entered.
2002-07-26 05:25:12 +00:00
tjr
ad903dff1e Avoid truncating filenames with snprintf(). 2002-06-29 05:31:26 +00:00
tjr
e20227aeb2 Respect LC_CTYPE and LC_COLLATE environment variables, mainly for their
effects on regular expressions. The libc regex code does not handle
equivalence classes well (for example), but we do our best.
2002-06-07 01:04:24 +00:00
tjr
054f70b470 Handle the case where a negative offset in a regular expression match
is larger than the number of lines in the overflow file.
2002-05-16 05:04:26 +00:00
tjr
f3cfd9a3f6 Correct synopsis and usage(): pattern arguments are not optional. 2002-05-16 04:39:19 +00:00
tjr
a776e9e8c8 Add the csplit(1) utility, which splits files based on context, as specified
by SUSv3.

PR:		36191
Reviewed by:	mike
2002-05-02 07:46:36 +00:00