Age | Commit message (Collapse) | Author |
|
when the user-specified format string ends with `%'.
|
|
|
|
instead of %-5h. The latter would make stat emit trailing spaces.
|
|
|
|
as we're now assuming that part of hosted C89.
|
|
to avoid warnings from gcc.
|
|
|
|
|
|
(print_user): Likewise.
This fixes a typo I introduced in who-users.c on 1996-02-23.
|
|
(print_entry): Likewise.
This fixes a typo I introduced in who-users.c on 1996-02-23.
|
|
|
|
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.
|
|
|
|
(check-README, ../AUTHORS): Use it.
|
|
|
|
|
|
E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
(fold_file): Move contents of `else'-block
out of conditional so it's used also for --spaces (-s).
|
|
system.h so the types from time.h and sys/time.h are available.
It appears that this is necessary for OpenBSD, NetBSD, and
Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
|
|
Set file timestamps with utimens, not utime.
|
|
(copy_internal): Set file timestamps with utimens, not utime.
|
|
(change_timestamps): Set file timestamps with utimens, not utime.
|
|
(re_protect): Set file timestamps with utimens, not utime.
|
|
|
|
|
|
|
|
|
|
|
|
(longopts, usage, next_file_name, main): Support -d.
(next_file_name, main): Allow -a0, as POSIX requires.
(next_file_name): Don't assume ASCII-like encoding;
'a' through 'z' are not contiguous in EBCDIC.
|
|
|
|
(cut_fields): Invoke getndelim2 rather than getdelim2.
|
|
|
|
|
|
and for the indices to iterate through nsigs.
|
|
types and to remove unnecessary casts.
(min, max): Remove. All uses changed to MIN and MAX.
(hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
keyfield.skipsblanks, struct keyfield.skipeblanks, struct
keyfield.numeric, struct keyfield.general_numeric, struct
keyfield.month, struct keyfield.reverse, reverse, unique,
have_read_stdin): Now bool, not int. All uses changed.
(eolchar): Now char, not int.
(struct keyfield.ignore): Now bool const *, not int *.
(struct keyfield.translate): Now char const *, not char *.
(struct month.name): Likewise.
(blanks, nonprinting, nondictionary): Now bool[], not int[].
(cleanup, inittables, keycompare, check, mergefps, first_same_file,
check, sort, main): Use const * pointers when possible.
(month_cmp): Rewrite to avoid casts.
(inittables): Initialize tables unconditionally, to avoid branches.
(fillbuf): Return bool, not int. All uses changed.
(fillbuf, keycompare, new_key, main):
Use SIZE_MAX rather than (size_t) -1.
(trailing_blanks): Renamed from trim_trailing_blanks.
Return the number of blanks to trim. All uses changed.
(getmonth): Use trailing_blanks rather than open code.
(keycompare): Do not cast char * to unsigned char *; not needed.
CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
ourselves.
(compare, main): Use | rather than || to avoid jumps.
Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
be nonzero there.
(check, first_same_file, sort, main):
Use bool instead of int local vars when possible.
(check): Merge the old 'checkfp' and 'check' into a single function,
that returns a boolean (true if the file was ordered).
All uses changed.
(main): Use int instead of unsigned for iterating through nsigs.
Rename local var "posix_pedantic" to "posixly_correct".
|
|
to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
|
|
E.g., `cut -f2' would do so.
|
|
From Paul Eggert.
|
|
|
|
(WORD_TABLE): New member alloc.
(ALLOC_NEW_WORD): Remove.
(occurs_alloc): New var.
(digest_word_file, find_occurs_in_text): Check for arithmetic
overflow when computing table size. Use xrealloc rather than
bumpalloc primitives.
|
|
|
|
|
|
`bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
would cause lines[-1 - swap] (with swap = false) to evaluate to
lines[4294967295].
|
|
directories, as required by POSIX. Reported by Karl Berry.
|
|
|
|
the new sort algorithm requires just 1.5.
|
|
(mergelines, sortlines_temp): New functions.
(sortlines): Use them, to reduce the number of times that
we need to copy 'struct line' values. This improved CPU
performance by about 30% on one 18 MB test.
(sort): Don't invoke sortlines unless we have 2 or more lines.
|
|
|
|
|
|
|