Jim Meyering [Wed, 25 Jan 1995 04:32:15 +0000 (04:32 +0000)]
* fmt.c (copy_rest): Replace `||' with `&&'. Before, a paragraph
not followed by a newline would be followed by data copied from
uninitialized storage. Repeat by `printf abc|fmt|od -ac'.
Reported by Franc,ois Pinard.
Jim Meyering [Wed, 25 Jan 1995 04:19:46 +0000 (04:19 +0000)]
Rename macros with FP_ prefix. Use FLOAT_ instead.
AIX-2.2.1 declares a typedef, FP_DOUBLE, that conflicted.
Be careful to use off_t instead of explicit `unsigned long'.
Otherwise, systems like 4.4BSD lose on calls to fseek that
expect off_t (which is long long on that system).
(parse_old_offset): Use xstrtoul
(main): Likewise.
Jim Meyering [Sun, 8 Jan 1995 20:20:19 +0000 (20:20 +0000)]
Remove FIXMEs.
(get_width_format): Use stub function if not all of the needed math
functions are available. From Ulrich.
(main): Give reason for failure.
Jim Meyering [Fri, 16 Dec 1994 05:45:57 +0000 (05:45 +0000)]
Include "error.h" instead of simply declaring `void error ();'.
(main): Don't advance optarg past leading sign -- otherwise, we'd
be making tail accept invalid options like `-+1'.
(tail_file): Fix call to error with %s in format, but no corresponding argument.
Jim Meyering [Mon, 12 Dec 1994 00:00:22 +0000 (00:00 +0000)]
sort.c (main): Fix interpretation of field offsets when specified
via -k option. They were being interpreted as zero-indexed.
POSIX says they are 1-based indices.
(keycompare): Don't ignore characters at the end of words
when otherwise they compare equal. Both from Rik Faith
<faith@cs.unc.edu>.
Jim Meyering [Sun, 11 Dec 1994 23:53:54 +0000 (23:53 +0000)]
* (<most functions>): Change the type of n_units/n_lines/n_bytes
to off_t because n_bytes is used as the option to fseek and off_t may
be long long (e.g. on BSD4.4). The only place where a 32-bit limit is
imposed is in the string-to-integer converstion of xstrtol.
(main): Use xstrtol instead of manual string to integer conversion.
Jim Meyering [Fri, 2 Dec 1994 16:54:56 +0000 (16:54 +0000)]
(checkfp): Initialize keybeg and keylim fields.
Before, this command
perl -e 'print join ("\n", (1..513)), "\n";'|sort -cs -n
failed on SunOS 4 systems. From Robert H. de Vries <robert@and.nl>.
Jim Meyering [Fri, 2 Dec 1994 16:49:47 +0000 (16:49 +0000)]
(xfclose): Report failed fflush. Otherwise, failed write to stdout
could be missed because of subsequent clearerr.
(main): Include filename in a couple error messages.
Add missing %s in an error format string.
Jim Meyering [Mon, 28 Nov 1994 06:00:56 +0000 (06:00 +0000)]
Make some globals `static' and/or `const'.
(LEN_STR_PAIR): New macro.
(decode_switches): Only ignore invalid TABSET value instead of dying.
(parse_ls_color): Use error, not fprintf.
(print_type_indicator): Remove dcls of two unused variables.
Jim Meyering [Fri, 18 Nov 1994 05:15:04 +0000 (05:15 +0000)]
(list_entries): Delete. Split in two actually...
(list_entries_users, list_entries_who, userid_compare): New functions.
(list_entries_users): Sort the user names. Reported by
Michael I Bushnell.
Topologically sort the functions and remove fwd declarations.