Age | Commit message (Collapse) | Author |
|
Don't include closeout.h.
|
|
|
|
|
|
from function returning non-void''.
|
|
|
|
http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
(file_lines): Add new parameter, *read_pos, and set it.
(pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
(tail_bytes, tail_lines, tail): Likewise.
(tail_file): Use the new `read_pos' value as the size,
rather than stats.st_size from the fstat call.
|
|
|
|
|
|
Use quote in diagnostics. Change many error format strings
from just `%s' to e.g., `error reading %s'.
(pipe_lines): Change type of parameter, n_lines, to uintmax_t.
Rewrite newline-counting loop to use memchr.
|
|
|
|
(dump_remainder): Move two declarations `down' into the scope
where they are used.
(xlseek): Return the resulting offset.
(file_lines): Rename parameter, file_length, to end_pos.
(pipe_lines): Don't coerce safe_read return value to `int'.
Adapt tests accordingly.
(pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
to `unsigned int'.
Change type of `total_bytes' from `int' to `size_t',
since the former wouldn't always be wide enough.
Don't coerce safe_read return value to `int',
and adapt tests accordingly.
Now that testing for a read error no longer involves
using `tmp', handle that case *after* freeing `tmp'.
(start_bytes): Clean up.
(tail_bytes): Now that `n_bytes' may be larger than
OFF_T_MAX, test for that condition and, if it's true, don't
use lseek optimizations.
(parse_options): Don't fail just because N_UNITS is larger than
the maximum size of a file -- tail may be applied to an input
stream (e.g., a pipe) with more data than that.
|
|
|
|
|
|
|
|
xrealloc, and xcalloc return values and of xrealloc's first argument.
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
|
|
[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.
|
|
|
|
an invalid byte or line count. Reported by Mikko Tuumanen.
|
|
to avoid overflow. Reported by Hans Lermen.
|
|
Move declaration of global variable, sleep_interval, to ...
(main): ...here.
(usage): Update description of --sleep-interval option.
(tail_forever): New parameter, sleep_interval. Update caller.
Use xnanosleep, rather than sleep.
(parse_options): New parameter, sleep_interval. Update caller.
Use xstrtod, now that we accept floating point values.
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
|
|
|
|
From Paul Eggert.
|
|
|
|
max_n_unchanged_stats_between_opens specially (as if it were
infinite) if it has its maximal value. Similarly for
max_n_consecutive_size_changes_between_opens.
|
|
line/byte count to be less than ULONG_MAX on systems where
OFF_T_MAX is larger.
|
|
(usage): Document only the intersection of the old and new behaviors,
to encourage portability.
(main, parse_obsolescent_option): Parse options using POSIX 1003.1-2001 rules if
conforming to that standard. Do not warn of obsolete options.
|
|
support of obsolete "-N" option syntax in expand, head, fold,
split, tail, unexpand, uniq, and which prohibits options with
optional arguments in od and pr.
(parse_obsolescent_option, main): Likewise.
|
|
|
|
(start_lines): Detect EOF, inform caller.
(tail_lines): Upon EOF in start_lines, return immediately.
|
|
unless POSIXLY_CORRECT.
|
|
|
|
support of obsolete "+" option syntax in sort, tail, and uniq.
(usage, parse_obsolescent_option): Implement the above.
|
|
|
|
HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION.
|
|
instead of hard-coding --help and --version descriptions.
|
|
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.
|
|
|
|
Call it instead of lseek, in most cases, so any failure is reported.
|
|
|
|
(tail_lines): Could have called file_lines even though the first
lseek failed. Fix that.
|
|
|
|
Work properly even when the read pointer is not at beginning of file.
(tail_lines): Call file_lines for any regular file, as long as lseek
can be used to seek to its end, not just when the initial read pointer
is at beginning of file.
|
|
(tail_file): Likewise for local `stats'.
|
|
(tail_lines): Use status of lseek (...SEEK_END) call
in deciding whether to call file_lines or pipe_lines.
From Herbert Xu.
|
|
|
|
Use fputs, not printf.
|
|
``Mandatory arguments to long options are mandatory for short options too.\n\''
|