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.
Jim Meyering [Thu, 17 Nov 1994 12:49:10 +0000 (12:49 +0000)]
(dump_remainder): Flush standard output just before
sleeping so that `tail -f' will output partial lines sooner.
This applies only when following the end of a single file.
From Leonard N. Zubkoff <lnz@dandelion.com>.
(file_lines, pipe_lines, pipe_bytes, start_bytes, start_lines, dump_remainder):
Use STDOUT_FILENO instead of `1' in XWRITE calls.
Jim Meyering [Fri, 11 Nov 1994 16:14:19 +0000 (16:14 +0000)]
(my_strtol): New function.
(main): Use it instead of atoi to convert argument strings to
major and minor device numbers. Now, mknod diagnoses invalid
device numbers and accepts octal and hexadecimal as well as
decimal string arguments. Ralf Lammers
<rlammers@physik.uni-osnabrueck.de> suggested that mknod accept
hex device numbers for compatibility with HPUX's mknod program.
Jim Meyering [Fri, 4 Nov 1994 06:04:02 +0000 (06:04 +0000)]
Include <limits.h> before system.h because limits.h on
some systems undefines PATH_MAX, whereas system.h includes pathmax.h
which sets PATH_MAX. From Kaveh Ghazi.