summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2003-08-17(strtoull): Remove unused declaration.Jim Meyering
2003-08-17Avoid unnecessary and sometimes time-consuming hostname lookups.Jim Meyering
(print_user): Likewise. This fixes a typo I introduced in who-users.c on 1996-02-23.
2003-08-17Avoid unnecessary and sometimes time-consuming hostname lookups.Jim Meyering
(print_entry): Likewise. This fixes a typo I introduced in who-users.c on 1996-02-23.
2003-08-17.Jim Meyering
2003-08-16(tail_lines): Fix a potential (but very hard to exercise)Jim Meyering
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).
2003-08-16An invalid initial value for *read_pos would result inJim Meyering
`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.
2003-08-15.Jim Meyering
2003-08-15(ASSORT): New var.Jim Meyering
(check-README, ../AUTHORS): Use it.
2003-08-15.Jim Meyering
2003-08-11.Jim Meyering
2003-08-11fold -s -wN would infloop for N < 8 with TABs in the input.Jim Meyering
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).
2003-08-10[!NICE_PRIORITY]: Include <sys/resource.h> afterJim Meyering
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.
2003-08-09Include utimens.h.Jim Meyering
Set file timestamps with utimens, not utime.
2003-08-09Include utimens.h.Jim Meyering
(copy_internal): Set file timestamps with utimens, not utime.
2003-08-09Include utimens.h.Jim Meyering
(change_timestamps): Set file timestamps with utimens, not utime.
2003-08-09Include utimens.h.Jim Meyering
(re_protect): Set file timestamps with utimens, not utime.
2003-08-09(main): Tweak Solaris OS version number in comment.Jim Meyering
2003-08-09Tweak Solaris OS version number in comment.Jim Meyering
2003-08-09(pipe_lines): Use memchr to skip lines, rather than an explicit loop.Jim Meyering
2003-08-09Add new undocumented option, --presume-input-pipe.Jim Meyering
2003-08-09.Jim Meyering
2003-08-09(suffix_alphabet): New var.Jim Meyering
(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.
2003-08-07.Jim Meyering
2003-08-07Include getndelim2.h rather than getdelim2.h.Jim Meyering
(cut_fields): Invoke getndelim2 rather than getdelim2.
2003-08-07.Jim Meyering
2003-08-06.Jim Meyering
2003-08-04(main): Use unsigned int instead of int for `nsigs'Jim Meyering
and for the indices to iterate through nsigs.
2003-08-03Minor code cleanups, mostly to use more accurateJim Meyering
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".
2003-08-02[!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>Jim Meyering
to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
2003-08-02(cut_fields): Don't read again after encountering EOF.Jim Meyering
E.g., `cut -f2' would do so.
2003-08-02(sortlines): Add description and references.Jim Meyering
From Paul Eggert.
2003-08-01(long_options, usage, main): Add --rfc-2822 option to GNU date.Jim Meyering
2003-08-01Do not include bumpalloc.h.Jim Meyering
(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.
2003-07-31.Jim Meyering
2003-07-28(sortlines_temp): Undo previous change.Jim Meyering
2003-07-27(sortlines_temp): Declare local `swap' to be `int', notJim Meyering
`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].
2003-07-27(prompt) [! recursive]: Don't prompt about unwritableJim Meyering
directories, as required by POSIX. Reported by Karl Berry.
2003-07-27remove trailing blanksJim Meyering
2003-07-27(sort): Don't require two `struct line's per text line,Jim Meyering
the new sort algorithm requires just 1.5.
2003-07-27This change was inspired by a similar proposal by Stepan Kasal.Jim Meyering
(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.
2003-07-27(is_printable_field): Simplify bit arithmetic.Jim Meyering
2003-07-27(validate_path): Use %lu, not %ld.Jim Meyering
2003-07-27(sort_files): Put `volatile' in the right place.Jim Meyering
2003-07-26.Jim Meyering
2003-07-26Include exitfail.h.Jim Meyering
(TEST_FAILURE): New constant, used for exit status if 'test' fails. (test-syntax_error): Use it. (binary_operator): Now takes bool arg specifying whether left operand is -l ARG, so that caller determines this rather than us. All uses changed. (term): Use posixtest to evaluate parenthesized subexpressions. (unary_operator, one_argument): Remove support for -t without operand. (one_argument): Take argument from argv[pos]. (one_argument, two_arguments, three_arguments): Advance pos. All callers changed. (three_arguments): Look for binary ops before "!". Then look for parenthesized one_argument expressions, instead of trusting expr () to do the right thing. (posixtest): Now takes number of args. All callers changed. Treat "( A B )" like "A B". (main): Set exit_failure to TEST_FAILURE. Don't depend on POSIXLY_CORRECT, as we now conform to POSIX by default. (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
2003-07-26Use only one bit per field/offset in array, not one `int'.Jim Meyering
(printable_field): Change type to `unsigned char'. (mark_printable_field, is_printable_field): New functions. Use them in place of all direct accesses of `printable_field'.
2003-07-26(set_fields): Detect overflow properly.Jim Meyering
2003-07-26(parse_tabstops): Detect overflow properly.Jim Meyering
2003-07-26 * src/rm.c: Include "dirname.h".Jim Meyering
(usage): Use base_name (program_name) in body of --help output. This lets me... * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
2003-07-26(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.Jim Meyering