Commit Graph
24019 Commits
Author SHA1 Message Date
Jim Meyering 4bc8b66e3a (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).
2001-08-24 07:56:46 +00:00
Jim Meyering e0f3ba1a46 update from libc 2001-08-24 06:39:29 +00:00
Jim Meyering 1683c6c470 update from glibc 2001-08-23 06:43:44 +00:00
Jim Meyering 24b279f642 wording tweak 2001-08-21 09:39:22 +00:00
Jim Meyering e82e2278a2 *** empty log message *** 2001-08-19 18:12:03 +00:00
Jim Meyering f623b9cc48 add paren tests 2001-08-18 21:21:40 +00:00
Jim Meyering 7808919ea4 *** empty log message *** 2001-08-18 21:21:15 +00:00
Jim Meyering 9ee54a9b3a (nextarg): Advance ARGS by one if the next token matches.
All callers changed.
2001-08-18 21:21:07 +00:00
Jim Meyering c0b3a3636c *** empty log message *** 2001-08-18 20:48:09 +00:00
Jim Meyering 74c1d7d5f4 00: new test 2001-08-18 20:47:57 +00:00
Jim Meyering dd08ddd29d *** empty log message *** 2001-08-18 20:46:04 +00:00
Jim Meyering 2169593a4f (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'.
2001-08-18 20:45:59 +00:00
Jim Meyering bf009adc4e . 2001-08-18 20:24:44 +00:00
Jim Meyering 2dce4a36d9 Code cleanup to avoid tricky macros and old-style function declarations.
(cmpf, less_than, less_equal, equal, not_equal, greater_equal,
greater_than, arithf, arithdivf, plus, minus, multiply, divide, mod):
Remove.

(eval4, eval3, eval2): Rewrite to avoid the need for the above macros
and functions.
2001-08-18 20:23:01 +00:00
Jim Meyering 69683b305d . 2001-08-18 19:29:51 +00:00
Jim Meyering f459045c8c . 2001-08-18 19:29:21 +00:00
Jim Meyering 1806cb5075 . 2001-08-18 19:00:40 +00:00
Jim Meyering 2764048933 *** empty log message *** 2001-08-18 17:48:37 +00:00
Jim Meyering 7012d1083e (binary_operator): Move declarations of lt,rt `down'
into the scopes where they're actually used.
(unary_operator): Likewise for `fd'.
2001-08-18 17:48:20 +00:00
Jim Meyering 406ddda49f *** empty log message *** 2001-08-18 17:45:37 +00:00
Jim Meyering 1c9af0041d (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.
2001-08-18 17:45:31 +00:00
Jim Meyering 9402bfd9ef add minus2 2001-08-18 17:14:52 +00:00
Jim Meyering a39a7f8ada (main): Handle a leading "--" option as POSIX requires. 2001-08-18 17:10:32 +00:00
Jim Meyering 95143d669f fix typo 2001-08-18 16:48:17 +00:00
Jim Meyering 5061ab5f05 *** empty log message *** 2001-08-18 16:39:58 +00:00
Jim Meyering 92b78195a1 (toarith): Don't accept plain "-" as a valid integer. 2001-08-18 16:39:33 +00:00
Jim Meyering bc70df09bb add more 2001-08-18 16:27:46 +00:00
Jim Meyering 2f327c7f34 *** empty log message *** 2001-08-18 16:19:26 +00:00
Jim Meyering 7650a9d9e4 *** empty log message *** 2001-08-18 16:13:16 +00:00
Jim Meyering b87d62b760 *** empty log message *** 2001-08-18 16:04:24 +00:00
Jim Meyering c6c2071280 Modify 'expr' so that it uses intmax_t, not int, to calculate
the value of integer expressions.

(struct valinfo.i): Now intmax_t, not int.
(docolon, int_value, str_value, isstring, nextarg, toarith,
freev, tostring, trace): Remove unnecessary forward decls.
(int_value, printv, tostring, toarith, arithf, arithdivf, docolon,
eval6, eval4, eval3): Do integer arithmetic using intmax_t, not int.
(docolon): Don't assume size_t fits in int.
2001-08-18 16:04:16 +00:00
Jim Meyering 28b012a9cc *** empty log message *** 2001-08-18 15:59:27 +00:00
Jim Meyering 821add521e 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.
2001-08-18 15:59:02 +00:00
Jim Meyering 1443d5fffa (jm_AC_TYPE_LONG_LONG): New macro. 2001-08-18 15:55:38 +00:00
Jim Meyering 24844c6332 renamed from ulonglong.m4 2001-08-18 15:54:36 +00:00
Jim Meyering a26140a98f renamed to longlong.m4 2001-08-18 15:54:35 +00:00
Jim Meyering 456b0e7bca renamed from inttypes_h.m4 2001-08-18 15:54:09 +00:00
Jim Meyering a1a34e0a9b renamed to inttypes.m4 2001-08-18 15:54:08 +00:00
Jim Meyering 955a34ed82 *** empty log message *** 2001-08-18 15:43:32 +00:00
Jim Meyering 6eb493e1db 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.
2001-08-18 15:43:28 +00:00
Jim Meyering 50f3294545 *** empty log message *** 2001-08-18 15:26:28 +00:00
Jim Meyering 1a6915b4d8 ($(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'.
2001-08-18 15:26:24 +00:00
Jim Meyering 4bc8a7b528 Merge in changes from autoconf. 2001-08-18 15:24:36 +00:00
Jim Meyering 9940a771e1 *** empty log message *** 2001-08-18 10:55:01 +00:00
Jim Meyering 88e4ad1d36 (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.
2001-08-18 10:54:56 +00:00
Jim Meyering 3e08e11574 . 2001-08-18 10:11:16 +00:00
Jim Meyering 215ba7757e (head_bytes): Read no more than the specified number of bytes. 2001-08-18 10:10:56 +00:00
Jim Meyering 54041560f5 *** empty log message *** 2001-08-18 10:10:29 +00:00
Jim Meyering dd553cb9e4 . 2001-08-18 09:27:50 +00:00
Jim Meyering 1dabc37a3a *** empty log message *** 2001-08-18 09:27:37 +00:00