Jim Meyering
6bcd4b08ba
(main): Call initialize_main.
2003-06-17 18:13:23 +00:00
Jim Meyering
b8735ae4a0
(cat): Remove `#ifndef ENOSYS', now that it's
...
guaranteed to be defined.
2003-06-16 09:11:39 +00:00
Jim Meyering
5f4fb36645
(cat): Don't advance the write pointer past the end of the write buffer.
2002-10-08 06:21:31 +00:00
Jim Meyering
00ebca59b7
(simple_cat, cat): Adapt to new safe_read ABI.
2002-10-06 15:48:49 +00:00
Jim Meyering
7e1ff0b4f8
(simple_cat): Use a temporary to avoid bogus warnings.
...
(cat): Declare insize and outsize to be of type size_t, not int.
Rearrange pointer/integer expressions to avoid bogus warnings.
(main): Declare insize and outsize to be of type size_t, not int.
2002-09-29 21:25:03 +00:00
Jim Meyering
234cd4e3fe
(close_stdout_wrapper): New, kludgey, function and file-scoped global.
...
(main): Register it with atexit.
Close STDOUT_FILENO, to avoid a problem when writing to
/dev/audio on at least Solaris 2.7 and 2.8 systems.
2002-08-26 07:23:37 +00:00
Jim Meyering
3124a4e393
(main): Close STDIN_FILENO rather than a literal `0'.
2002-08-25 14:32:02 +00:00
Jim Meyering
5a731510b2
(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.
2002-07-02 09:06:33 +00:00
Jim Meyering
39ae860d5b
(simple_cat, cat, main): Used char * rather than
...
unsigned char *, to avoid some technical violations of the C
standard, and to avoid the need for casts. I guess the
unsigned char * was probably there for improved performance
with ancient compilers, but the code wasn't using the
unsignedness any more.
Reported by Nelson H. F. Beebe.
(cat): int -> size_t for full_write arg. This doesn't
fix any bugs since the buffer size is small, but it makes
the code a bit clearer.
2002-02-23 09:12:20 +00:00
Jim Meyering
3a0a028c8c
Reflect renaming to, and new usage of these macros:
...
HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION.
2001-12-01 17:41:25 +00:00
Jim Meyering
afa12bc912
(usage): Use new macros, EMIT_HELP_DESCRIPTION and EMIT_VERSION_DESCRIPTION
...
instead of hard-coding --help and --version descriptions.
2001-12-01 17:21:56 +00:00
Jim Meyering
8087128c07
(cat): Don't test whether the full_write return value (of type size_t)
...
is less than 0. Reported by Nelson H. F. Beebe,
as a warning from Irix 6.5's C compiler.
2001-11-26 12:16:48 +00:00
Jim Meyering
909dc8c01d
Factor out some common strings to make translation easier.
...
Split usage strings so that --help and --version descriptions are alone
in their own string.
Likewise for the one that says:
Mandatory arguments to long options are mandatory for short options too.
2001-11-23 19:58:23 +00:00
Jim Meyering
2237d0c5d1
(usage): Split --help output into smaller pieces.
...
Use fputs, not printf.
2001-11-11 13:41:19 +00:00
Jim Meyering
30cc300814
copyright
2001-08-31 07:45:28 +00:00
Jim Meyering
722e2f0957
Include full-write.h.
...
(full_write): Remove decl; not needed.
(simple_cat, cat): Don't assume read and write size fits in int.
2001-08-31 07:45:12 +00:00
Jim Meyering
41a201e991
(AUTHORS): Mark string for translation, since it contains the English word `and'.
2001-08-13 10:33:28 +00:00
Jim Meyering
13e80acf07
The command, `yes ''|./cat -n' would stop printing after INT_MAX lines.
...
(cat): Never let `newlines' exceed 3.
2000-10-21 19:57:41 +00:00
Jim Meyering
51e2ffc524
Prevent a counter buffer overrun when numbering lines and when
...
processing 100 billion lines (or more) of input.
(LINE_COUNTER_BUF_LEN): Define to allow numbering as
many as 10^18 - 1 lines (the old limit was 10^11 - 1, and could
be exceeded without too much trouble). Use this symbol rather
than hard-coding the constant everywhere. Rather than overruning
for input with more lines, mark the line number by putting a
`>' in the leftmost slot.
(next_line_num): Fixed (now academic) possible line buffer overrun.
Patch by Jan Nieuwenhuizen.
2000-10-21 19:16:37 +00:00
Jim Meyering
fd5da15041
(closeout_func): Remove variable.
...
(close_stdout_wrapper): Remove unused function.
(main): Remove assignment to closeout_func.
2000-08-07 13:23:44 +00:00
Jim Meyering
62e3f1f1ef
(main): Correct a comment.
2000-06-22 17:10:51 +00:00
Jim Meyering
8ccf29f7fe
Arrange to call close_stdout upon exit.
...
Don't close stdout explicitly. Replace uses of global constant,
output_desc, with uses of STDOUT_FILENO.
2000-05-27 21:14:26 +00:00
Jim Meyering
98270d63fb
(main): When stdout is in binary mode, make sure all
...
input files are also read in binary mode.
1999-05-18 14:13:33 +00:00
Jim Meyering
e6bc0dccbc
(main): Declare out_dev to be of type dev_t, not `int'.
...
Declare out_ino to be of type ino_t, not `int'.
1999-04-13 01:11:46 +00:00
Jim Meyering
d815c152df
Standardize --help and --version processing.
1999-04-04 15:44:26 +00:00
Jim Meyering
c21cecaea8
Use AUTHORS in place of string in parse_long_options call.
1999-04-03 05:26:48 +00:00
Jim Meyering
1d47220ab2
Insert AUTHORS definition.
1999-04-03 05:22:05 +00:00
Jim Meyering
cf691ec714
Use PROGRAM_NAME in place of string in parse_long_options call.
1999-04-03 05:20:06 +00:00
Jim Meyering
7c2d5de6c7
define PROGRAM_NAME
1999-04-03 05:01:48 +00:00
Jim Meyering
88cbad9817
Include long-options.h
...
[long_options]: Remove the "help" and "version" entries.
Remove declarations of show_help and show_version.
(main): Use parse_long_options, including author name(s).
Remove the show_version and show_help blocks.
1999-03-04 05:36:10 +00:00
Jim Meyering
7568de8654
update copyright dates
1999-02-16 04:20:43 +00:00
Jim Meyering
9fec9172be
Don't prototype usage as static.
1999-01-14 18:25:16 +00:00
Jim Meyering
7914fb4069
(usage) [O_BINARY]: Describe -B,--binary option.
...
(main) [O_BINARY]: binary_files, binary_output, file_open_mode:
new variables. Add --binary to long_options[]. Switch stdin and
stdout to binary mode unless file contents are not important
anyway. Open files in binary mode when required.
1999-01-01 22:20:23 +00:00
Jim Meyering
6880f434c0
update bug-reporting address
1998-09-19 17:24:05 +00:00
Jim Meyering
d4257e63c7
Use STREQ rather than strcmp
1998-04-12 09:27:45 +00:00
Jim Meyering
66c7b3c41d
Include safe-read.h instead of merely declaring safe_read.
1998-04-11 18:23:13 +00:00
Jim Meyering
3a62f8785f
(cat): Convert comma-expressions to pairs of
...
semicolon-terminated stmts.
Add braces around compound if/else stmts.
1998-01-25 08:25:05 +00:00
Jim Meyering
e211bb2aff
Remove old-style xmalloc and xrealloc decls.
1997-10-25 04:45:43 +00:00
Jim Meyering
d4899bad7e
Remove stpcpy dcl.
1997-10-23 14:28:31 +00:00
Jim Meyering
3ea2606e41
indent cpp directives to reflect nesting
1997-10-07 23:58:29 +00:00
Jim Meyering
3f3f566627
update bug-reporting address
1997-10-07 23:55:52 +00:00
Jim Meyering
dbc538f92b
update copyrights for 1997
1997-02-09 04:46:02 +00:00
Jim Meyering
e077b7593b
bracket bug address with <> and append a period
1997-02-01 04:24:58 +00:00
Jim Meyering
c2d2dec516
Compare getopt_long return value against -1, not EOF. Use NULL, not '(int *) 0' as last parameter in getopt_long call.
1997-02-01 02:00:04 +00:00
Jim Meyering
e298f1f300
(usage): Alphabetize options like sort -f would.
1996-11-23 22:06:55 +00:00
Jim Meyering
2e55854100
change bug-reporting address
1996-11-03 03:16:23 +00:00
Jim Meyering
17c0c658f1
change bug-reporting address
1996-11-02 20:44:52 +00:00
Jim Meyering
630b771f1b
(main): update --version output again
1996-10-04 04:25:46 +00:00
Jim Meyering
3361bd2bca
(main): update --version output to conform to coding standard
1996-10-04 04:15:08 +00:00
Jim Meyering
39c406f18a
.
1996-10-01 01:10:54 +00:00