Commit Graph

17 Commits

Author SHA1 Message Date
bjh21 548e2c20bb Clean up the mechanism used for opening output files. Rather than freopening
stdout onto each file in turn, then writing through fileno(stdout), use
open() and close() like any sensible program.  This saves a lot of system
calls, removes a dependency on the particular behaviour of BSD freopen(),
and allows us to detect and report errors from close().
2003-06-29 22:57:23 +00:00
bjh21 4fca23a8b3 Simplify the handling of ifd by initialising it to the default
(STDIN_FILENO), and only overriding that if the user specifies a different
input file.
2003-06-26 23:19:15 +00:00
bjh21 946564c3f6 Remove support for treating "-" as an option rather than an operand. The
practical consequence of this is that "-" is treated the same as a file name,
and can't have options specified after it.  This is consistent with other
utilities and with POSIX.
2003-06-26 23:06:52 +00:00
bjh21 5b24c0821c Delint. This largely involves using size_t and off_t appropriately rather
that throwing around unsigned long long.  There are a few LINTED comments
where I'm sure overflow can never occur, and with these lint gives this
a clean bill of health.
2003-06-26 22:49:53 +00:00
bjh21 0de24d10b1 Light KNF and comment tidying. 2003-06-24 18:45:08 +00:00
bjh21 c8e096241e Use pathconf() to get the value of {NAME_MAX} for the current directory,
rather than relying on the #defined one (which is wrong on NetBSD).
Dynamically allocate the filename buffer to fit.
2003-06-24 00:09:26 +00:00
bjh21 0b52d9cd7b From FreeBSD:
Allow "-" to be specified as an operand as well as an option.
SUSV3 requires something like "split -- -" to work. Document the "-" operand.
2003-06-10 16:57:05 +00:00
bjh21 2ef4680e17 Add support for the -a option, which should fix standards/11226.
Code from <hiramatu@boreas.dti.ne.jp>, with improvements from me.
Manual page updates from FreeBSD.
2003-06-10 16:32:54 +00:00
christos 2bdc2add9c PR/20818: Martin Husemann: Split does not handle >= 2G files. 2003-03-20 14:12:49 +00:00
lukem 3f8c4dac86 revert previous 1999-11-02 10:55:47 +00:00
lukem 0895d2339e remove superfluous '-' in getopt string 1999-11-02 10:52:49 +00:00
lukem 9ea1c85731 WARNSify, fix .Nm usage, getopt returns -1 not EOF 1997-10-19 23:26:56 +00:00
jtc 0c3e631d7d Sync with 4.4lite2 1995-08-31 22:22:05 +00:00
jtc 5233fb4026 Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
1994-12-21 08:11:23 +00:00
cgd e104a4a2bc don't core if -b is given no argument. bug pointed out by nate williams,
fix by me.
1994-04-06 00:04:09 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00