Age | Commit message (Collapse) | Author |
|
|
|
Replace sole use with equivalent `#ifdef S_ISLNK'.
Inconsistency reported by Dmitry V. Levin.
|
|
so that help2man produces properly formatted man pages.
|
|
Based on suggestions from Solar Designer and Dmitry V. Levin.
Add comments.
|
|
(sighandler): New function, based on the one in sort.c.
(main): Use sigaction, if possible; otherwise signal.
Handle these signals:
SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
Don't register our handler if the signal is already being ignored.
|
|
|
|
(main): Declare `nsigs' to be unsigned, not int.
|
|
|
|
|
|
|
|
Include "full-write.h" and <signal.h>.
(restore_default_color, restore_default_color_handler): New functions.
(sigtstp_handler, put_indicator_direct): New functions.
(main) [print_with_color]: Register signal handlers.
Patch mostly by Solar Designer and Stanislav Ievlev.
|
|
(output_block_size): Now uintmax_t, not int, to handle larger
block sizes. All uses changed.
|
|
human.h, to print large numbers simply.
(human_output_opts): New var.
(output_block_size): Now uintmax_t, not int, to handle larger
block sizes. All uses changed.
(print_header): In the header line, prefer SI to human
representation if it's shorter; if neither is shorter, try to
intuit what the user would prefer.
|
|
|
|
Use primitives from inttostr.h, not
human.h, to print large numbers simply.
(human_output_opts): New var.
(output_block_size): Now uintmax_t, not int, to handle larger
block sizes. All uses changed.
(file_output_block_size): New var, to distinguish
file sizes from other sizes.
(decode_switches): Set it.
|
|
|
|
at most two hex. digits, not three.
|
|
|
|
to print large numbers simply.
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
(OUTPUT_BLOCK_SIZE): remove.
(dopass): When printing progress, use floor for what has been done
so far (since we should be conservative there), and ceiling for
what needs to be done (since that's what other programs use).
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
|
|
human.h, to print large numbers simply.
|
|
Remove now-useless cast.
(stdread): Remove function.
(bytes_split): Use size_t instead of int.
Use safe_read, not stdread.
(lines_split): Likewise.
Use memchr rather than a `while' loop.
(line_bytes_split): Use size_t instead of int.
Use safe_read, not stdread.
(main): Add some FIXME comments to remind me to remove casts.
|
|
|
|
reproduce HPUX-11 cat failure.
|
|
give invalid (unreasonably large) values for stat.st_blksize.
(ST_BLKSIZE): Ensure that the result is in [1..4MB].
|
|
could cause nl to segfault.
(build_print_fmt): Don't include separator string
in the printf format; it might contain `%'.
Use a better bound on the length of the print_fmt buffer.
(print_lineno): Print the separator here instead.
|
|
|
|
|
|
a command-line argument.
Reported by Michal Svec. Based on a patch by Andreas Schwab.
|
|
|
|
|
|
|
|
|
|
of type size_t, since that's the way it's used and avoids a warning.
|
|
since that's how it's always used and avoids a new warning from gcc.
(read_input): Adapt to new safe_read ABI.
|
|
|
|
Declare local `bytes' accordingly, to avoid warning.
|
|
[this change is analogous (bytes vs. lines) to the one of 2002-01-27]
(start_bytes): Detect EOF, inform caller.
(tail_bytes): Upon EOF in start_bytes, return immediately.
(file_lines): Reorganize to use memrchr rather than an explicit loop.
Adapt to new safe_read ABI.
|
|
|
|
|
|
Patch by Dmitry V. Levin.
|
|
|
|
|
|
|