summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2003-08-30(do_link): Use SAME_INODE rather than open-coding it.Jim Meyering
2003-08-30When source and destination arguments refer to the same file, resideJim Meyering
on a partition (e.g. VFAT) on which distinct names may refer to the same directory entry (often due to variations in case), and when the link count for the file is 1, mv no longer unlinks the file. FIXME: this is a band-aid fix. If the file happens to have a link count of 2 or greater, mv will still unlink it. (same_file_ok): Invoke same_name (which might still return false for names that refer to the same directory entry) only if the link count is 2 or more.
2003-08-27(paste_parallel): Don't output `EOF' (aka -1) as a `char'.Jim Meyering
This would happen for nonempty files not ending with a newline.
2003-08-27.Jim Meyering
2003-08-27(print_it): Avoid buffer overrun that would occurJim Meyering
when the user-specified format string ends with `%'.
2003-08-25(main): Warn about use of deprecated `-l' option.Jim Meyering
2003-08-22(do_stat): For link count at end of line, use %h format,Jim Meyering
instead of %-5h. The latter would make stat emit trailing spaces.
2003-08-19.Jim Meyering
2003-08-19Include stdlib.h unconditionally,Jim Meyering
as we're now assuming that part of hosted C89.
2003-08-18(textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,Jim Meyering
to avoid warnings from gcc.
2003-08-18.Jim Meyering
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.