Age | Commit message (Collapse) | Author |
|
when applied to files in /proc and /sys, even when the FIONREAD
ioctl produces nonsensical results. Before this change, cat would
produce no output (or truncated output), for some linux kernels.
* src/cat.c (write_pending): New function, factored out of cat.
(cat): Also interpret a negative ioctl/FIONREAD count as indicating
that there are bytes to read. Some versions of linux-2.6.16 do that.
Write any pending output before returning.
Reported by Dan Jacobson in <http://bugs.debian.org/370583>.
* NEWS: Mention this bug fix.
* tests/misc/cat-proc: New file. Test for the above.
* tests/misc/Makefile.am (TESTS): Add cat-proc.
|
|
|
|
|
|
Remove support for -B. Use same rules as other programs to decide
whether to use binary I/O, except that the -bensAE options always
select text mode.
(main): Avoid setmode; use POSIX-specified routines instead.
|
|
|
|
Use HAVE_FIONREAD_IN_SYS_IOCTL instead of _POSIX_SOURCE
to decide whether to include <sys/ioctl.h>.
|
|
Include "quote.h".
Rather than this: error (..., "...`%s'...", arg);
do this: error (..., "...%s...", quote (arg));
|
|
|
|
|
|
Don't close STDOUT_FILENO explicitly; close_stdout does it.
|
|
|
|
|
|
'ok' flag around.
(simple_cat, cat): Return true if successful. All callers changed.
(simple_cat, cat, main): Use bool for booleans.
(simple_cat): Use size_t for sizes.
(cat, main): Use the same names for parameters that we use for
long options, to avoid confusion. This inverts the sense of the
show_tabs (formerly output_tabs) and number_nonblank
(formerly numbers_at_empty_lines) variables.
(main): Don't mess up (due to integer overflow) if we are given
INT_MAX - INT_MIN + 1 options.
[O_BINARY]: Don't invoke isatty unless the other options require it.
(main): When deciding whether to use simple_cat, don't worry
about binary option; it's irrelevant.
|
|
|
|
(main): Align I/O buffers to page boundaries.
|
|
(usage): Don't bother normalizing exit status
since the arg is already the correct exit status now.
|
|
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
|
|
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
|
|
Don't include closeout.h.
|
|
|
|
guaranteed to be defined.
|
|
|
|
|
|
(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.
|
|
(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.
|
|
|
|
|
|
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.
|
|
HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION.
|
|
instead of hard-coding --help and --version descriptions.
|
|
is less than 0. Reported by Nelson H. F. Beebe,
as a warning from Irix 6.5's C compiler.
|
|
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.
|
|
Use fputs, not printf.
|
|
|
|
(full_write): Remove decl; not needed.
(simple_cat, cat): Don't assume read and write size fits in int.
|
|
`and'.
|
|
(cat): Never let `newlines' exceed 3.
|
|
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.
|
|
(close_stdout_wrapper): Remove unused function.
(main): Remove assignment to closeout_func.
|
|
|
|
Don't close stdout explicitly. Replace uses of global constant,
output_desc, with uses of STDOUT_FILENO.
|
|
input files are also read in binary mode.
|
|
Declare out_ino to be of type ino_t, not `int'.
|
|
|
|
|
|
|
|
|
|
|