Jim Meyering [Sat, 25 Aug 2001 15:07:17 +0000 (15:07 +0000)]
(main): Fix some more incompatibilities with POSIX.2,
(e.g. `uniq +3 --' did not work) by invoking getopt_long with
leading '-', resembling what was done to 'sort' on 2001-03-20.
Recognize an +N option only if it is an integer in range, and
(if POSIXLY_CORRECT) only if a file name argument has not been seen;
otherwise silently treat it as a file name.
If the user specifies too many operands, output the first one
in the error message, as a diagnostic aid.
Jim Meyering [Sat, 25 Aug 2001 09:19:59 +0000 (09:19 +0000)]
(different): Don't assume that lengths can fit
into size_t. Tune code for the common case where the line
lengths differ: we avoid comparing them entirely in that case.
Jim Meyering [Sat, 25 Aug 2001 07:33:20 +0000 (07:33 +0000)]
Remove arbitrary restrictions on sizes, fixing a bug reported
by Geoff Whale.
(skip_fields, skip_chars, check_chars): Now size_t, not int.
(size_opt): New function. Do not arbitrarily reject size zero.
Change the wording of the error message slightly, for convenience.
(find_field): Use size_t, not int, to compute sizes.
(different, main): check_chars==0 is no longer a special case, as
it defaults to SIZE_MAX.
(main): Check for overflow with args like -234234234234234.
Use 'size_opt' to convert optional arguments to sizes.
Jim Meyering [Sat, 25 Aug 2001 05:42:46 +0000 (05:42 +0000)]
(find_field): Don't count trailing newline to be
part of the field. This disagrees with POSIX.2, but it's
gotta be a bug in the standard. An interpretations request
has been submitted to PASC.
Jim Meyering [Fri, 24 Aug 2001 07:56:46 +0000 (07:56 +0000)]
(posixly_correct): Remove; no longer needed.
(main): Do not worry about POSIXLY_CORRECT, as it's OK for
expr to have options (so long as they do not begin with digits).
Jim Meyering [Sat, 18 Aug 2001 20:45:59 +0000 (20:45 +0000)]
(isstring): Remove.
(eval2): Do comparisons as strings first, before trying to convert to
integer. This avoids loss of information and wrong result, e.g. for
"expr '00' '<' '0!'", where you don't want to convert '00' to '0'.
Jim Meyering [Sat, 18 Aug 2001 17:45:31 +0000 (17:45 +0000)]
(isint, binary_operator, unary_operator):
Use intmax_t for argument integers, not long.
(age_of, binary_operator): Use time_t for times, not long.
(unary_operator): If N is out of int range, -t N now returns false.
Jim Meyering [Sat, 18 Aug 2001 15:59:02 +0000 (15:59 +0000)]
Add AC_PREREQ(2.13).
(jm_AC_HEADER_INTTYPES_H): Test for intmax_t, too.
(jm_AC_TYPE_INTMAX_T): New macro.
(jm_AC_TYPE_UINTMAX_T): Moved here from uintmax_t.m4.
Jim Meyering [Sat, 18 Aug 2001 15:43:28 +0000 (15:43 +0000)]
Revert part of last change and solve the problem a better way.
(show_date) [--rfc-822]: Set LC_ALL=C just before
calling strftime and restore it just afterwards.
Suggestion from Ulrich Drepper.
Jim Meyering [Sat, 18 Aug 2001 15:26:24 +0000 (15:26 +0000)]
($(v_etc_file)): Define.
(copyright-check): Use the new variable.
(my-distcheck): Depend on local-check so those checks are once
again run by `make distcheck'.
Jim Meyering [Sat, 18 Aug 2001 10:54:56 +0000 (10:54 +0000)]
(show_date) [--rfc-822]: Don't space-pad the day of the month.
Set only LC_TYPE to the "C" locale. Setting LC_ALL is overkill,
and would have unwanted side effects if there is an error message.