Jim Meyering
3ca688d69a
Don't include "xalloc.h", as system.h already does that via sys2.h.
2002-01-21 19:53:23 +00:00
Jim Meyering
2fae9e5d26
Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION
...
instead of hard-coding --help and --version descriptions.
Split --help output into smaller pieces.
Use fputs, not printf.
2001-12-15 20:46:30 +00:00
Jim Meyering
9e1b4e382a
(usage): Indent --help and --version strings to start in the 7th column.
2001-11-25 14:46:05 +00:00
Jim Meyering
1463ff6353
(nextarg): Use strcoll, not strcmp.
2001-08-26 05:40:46 +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
9ee54a9b3a
(nextarg): Advance ARGS by one if the next token matches.
...
All callers changed.
2001-08-18 21:21:07 +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
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
a39a7f8ada
(main): Handle a leading "--" option as POSIX requires.
2001-08-18 17:10:32 +00:00
Jim Meyering
92b78195a1
(toarith): Don't accept plain "-" as a valid integer.
2001-08-18 16:39:33 +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
1a898f0449
Include "closeout.h".
...
(main): Call atexit with close_stdout.
2000-05-07 14:52:16 +00:00
Jim Meyering
59339ab7e5
(NEW): Undefine to avoid warning about redefinition.
...
(NEW): Redefine in terms of XMALLOC.
1999-11-09 20:41:18 +00:00
Jim Meyering
1aab3474a1
Remove xstrdup declaration.
1999-09-02 21:33:00 +00:00
Jim Meyering
39090114f0
(PROGRAM_NAME, AUTHORS): Define and use.
1999-03-31 04:11:35 +00:00
Jim Meyering
ff743d5451
(main): Include author name argument in call to parse_long_options.
1999-03-04 14:02:14 +00:00
Jim Meyering
df7b9c808b
update copyright dates
1999-02-16 04:17:15 +00:00
Jim Meyering
276d118b10
(usage): Remove static attribute.
1999-01-25 14:33:38 +00:00
Jim Meyering
24a8bf2d3e
update bug-reporting address
1998-09-19 17:32:35 +00:00
Jim Meyering
f3c14cb59f
revert back to using lower case _unlocked wrapper names
1998-06-29 16:24:01 +00:00
Jim Meyering
c5eb9edf26
Change all uses of unlocked-wrapped functions to their upper case wrapper names.
1998-06-29 02:13:21 +00:00
Jim Meyering
2e308957d4
s/__P/PARAMS/
1997-12-21 22:30:30 +00:00
Jim Meyering
b3ab88e970
Remove old-style xmalloc and xrealloc decls.
1997-10-25 22:03:20 +00:00
Jim Meyering
1f98316792
Remove strstr decl.
1997-10-23 15:57:36 +00:00
Jim Meyering
5db3c9bdb4
update bug-reporting address
1997-10-07 23:51:39 +00:00
Jim Meyering
d0c515b45c
indent
1997-07-13 03:07:36 +00:00
Jim Meyering
a6526f2171
(eval6): Accept new unary operator, quote.
...
From Karl Heuer.
1997-06-16 17:01:24 +00:00
Jim Meyering
8406b91aba
(docolon): Test (re_buffer.re_nsub > 0) rather than
...
searching for `\(' to determine whether to return 0 or the empty
string. Before it would improperly return '' if the pattern
contained a substring like this: `\\('. From Karl Heuer.
For example, running expr c : '\\(' should print `0'.
1997-06-11 20:18:15 +00:00
Jim Meyering
7eb03c4372
update copyrights for 1997
1997-02-09 04:54:16 +00:00
Jim Meyering
899a90bfd9
bracket bug address with <> and append a period
1997-02-01 04:23:31 +00:00
Jim Meyering
5582e6dad3
change bug-reporting address
1996-11-03 03:16:27 +00:00
Jim Meyering
b8e689dc67
change bug-reporting address
1996-11-02 20:44:15 +00:00
Jim Meyering
f04044ed86
(main): update --version output to conform to coding standard
1996-10-05 16:37:57 +00:00
Jim Meyering
e9d17da073
(usage): Tell where to report bugs.
1996-09-02 15:52:45 +00:00
Jim Meyering
2b1f600cbd
(usage): Remove space before newline in usage message.
1996-07-05 03:40:21 +00:00
Jim Meyering
f1d4b41340
(docolon): Give a warning when the first character
...
of the basic regular expression is `^'.
1996-05-30 02:32:03 +00:00
Jim Meyering
2d8de9b8ab
(main): Don't recognize --help, --h, --he, --version, --v, etc.
...
if the POSIXLY_CORRECT environment variable is set.
(docolon) [RE_SYNTAX_POSIX_BASIC]: Revert my misguided change of Mar 1.
1996-05-18 18:36:10 +00:00
Jim Meyering
e6eece1575
update Copyright years for 1996
1996-04-24 04:45:54 +00:00
Jim Meyering
318a497768
Update FSF's address.
1996-03-24 18:33:12 +00:00
Jim Meyering
1954f681c6
(main): Declare to be of type int, not void.
1996-03-21 22:47:02 +00:00
Jim Meyering
3ee97d4d5b
Don't include version.h.
...
(main): Use PACKAGE_VERSION instead of version_string.
1996-03-16 16:14:26 +00:00
Jim Meyering
6fc4ae7a28
(main): Initialize for internationalized message support:
...
call setlocale, bindtextdomain, and textdomain.
1996-03-12 23:49:29 +00:00
Jim Meyering
3d2a9041f9
(docolon): Don't use deceptively-named RE_SYNTAX_POSIX_BASIC -- it recognizes
...
non-BRE \?, \+, and \|. Instead, use RE_SYNTAX_POSIX_MINIMAL_BASIC.
1996-03-02 02:45:20 +00:00
Jim Meyering
9a181424ac
(eval6): Cast strlen to int to avoid warning from gcc -Wall.
1996-02-29 02:53:37 +00:00
Jim Meyering
34e1cf8304
(cmpf): Indent macro uses so ansi2knr doesn't mistake them
...
for function dcls and munge them.
(arithf): Likewise.
(arithdivf): Likewise.
1996-02-24 18:25:29 +00:00
Jim Meyering
85f9983c19
(docolon): Set re_syntax_options to RE_SYNTAX_POSIX_BASIC
...
so expr's pattern matching uses BASIC (not GNU-extended) REs.
Reported by Jim Kingdon.
1996-02-23 16:13:53 +00:00
Jim Meyering
53398947a1
Protoize and __P-protect forward dcls.
1996-01-06 11:44:05 +00:00
Jim Meyering
f0556f3517
Annotate localizable strings with _(...). From Franc,ois.
1995-08-08 04:37:34 +00:00
Jim Meyering
635b1b5b6e
(usage): Add one- and two-line descriptions to --help output.
...
From Karl.
1995-05-15 04:53:56 +00:00
Jim Meyering
0d6850348c
add 1995 to Copyright dates
1995-03-09 22:33:05 +00:00