Commit Graph
22888 Commits
Author SHA1 Message Date
Jim Meyering a2057e286e *** empty log message *** 2001-08-25 09:04:33 +00:00
Jim Meyering 74f084382d *** empty log message *** 2001-08-25 07:33:39 +00:00
Jim Meyering 59d2dceb2c 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.
2001-08-25 07:33:20 +00:00
Jim Meyering b087829d9b Add new test, #54, for the just-fixed bug. 2001-08-25 05:48:19 +00:00
Jim Meyering a6cac026c6 *** empty log message *** 2001-08-25 05:42:53 +00:00
Jim Meyering 81cb734910 (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.
2001-08-25 05:42:46 +00:00
Jim Meyering 90790efabe *** empty log message *** 2001-08-25 05:42:07 +00:00
Jim Meyering 8e092dca08 (cut invocation): Document how cut treats lines with no separators. 2001-08-24 08:48:21 +00:00
Jim Meyering fa10fa9e64 *** empty log message *** 2001-08-24 08:41:48 +00:00
Jim Meyering 9c2368bab8 Use n_users' in place of argc - optind' in two more places. 2001-08-24 08:41:26 +00:00
Jim Meyering 815dafff5a (main): Fail if -l is specified with no username. 2001-08-24 08:40:29 +00:00
Jim Meyering 5f6b9742d1 *** empty log message *** 2001-08-24 08:31:11 +00:00
Jim Meyering b64b2719bc (usage): Clarify description of -l. From Clark Morgan. 2001-08-24 08:31:02 +00:00
Jim Meyering 3fcc2c725f . 2001-08-24 08:11:30 +00:00
Jim Meyering 8126042cb4 *** empty log message *** 2001-08-24 07:59:09 +00:00
Jim Meyering 30d2217876 *** empty log message *** 2001-08-24 07:59:02 +00:00
Jim Meyering c8de90386d *** empty log message *** 2001-08-24 07:58:42 +00:00
Jim Meyering 1553648f54 *** empty log message *** 2001-08-24 07:58:21 +00:00
Jim Meyering aef02ded49 'expr' now requires '+' rather than 'quote' to quote tokens. 2001-08-24 07:58:15 +00:00
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