Age | Commit message (Collapse) | Author |
|
(usage): Don't bother normalizing exit status
since the arg is already the correct exit status now.
|
|
|
|
Fail when following by name but no names are specified.
|
|
(parse_options): Update xstrtod call to include new argument, c_strtod.
|
|
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.
|
|
gcc's warning about shadowing a global.
|
|
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.
|
|
(parse_options): Give a diagnostic for (but still accept) the
deprecated --allow-missing option.
|
|
(struct linebuffer, struct charbuffer): Change nbytes and nlines from
unsigned int to size_t. unsigned int is safe (after the 2003-09-03 patch)
but size_t is cleaner.
(pipe_bytes): Likewise for local variable 'i', which was 'int'.
Standardize on BUFSIZ as opposed to other macro names and values.
(BUFSIZ) [!defined BUFSIZ]: Remove. stdio.h has always defined it,
and other code already assumes it's defined.
|
|
|
|
race condition bug. The bug would be triggered when tailing a file
with file pointer not at beginning of file, and where the file was
truncated to have a length of less than the initial offset at just
the right moment (between the two lseek calls in this function).
|
|
`tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
busy-wait rather than sleeping between iterations. The bug manifests
itself only when tailing regular files that are initially nonempty.
(tail_bytes): Set *read_pos to new file offset after
each xlseek call.
(tail_lines): Likewise, after lseek calls.
|
|
|
|
|
|
|
|
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.
|