summaryrefslogtreecommitdiffstats
path: root/bin/expr/expr.y
Commit message (Collapse)AuthorAgeFilesLines
* Create a small library function, check_utility_compat(3), to determinewollman2002-10-281-1/+2
| | | | | | | | whether a named utility should behave in FreeBSD 4.x-compatible mode or in a standard mode (default standard). The configuration is done malloc(3)-style, with either an environment variable or a symlink. Update expr(1) to use this new interface.
* EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,wollman2002-05-111-0/+1
| | | | and -e reflects the historic behavior of FreeBSD's expr.
* The response to my POSIX interpretation request says that `expr'wollman2002-05-101-30/+65
| | | | | | is required to be oblivious to overflow and to use the data type `long'. (Division by zero is undefined in ISO C so it's still OK to check for it here.) Add a new `-e' flag to get the old, more useful behavior.
* Provide an environment variabloe, EXPR_COMPAT, which disables optionwollman2002-04-221-8/+11
| | | | parsing for compatibility with old implementations.
* Make expr POSIX-compliant, and fix some bugs. Specifically:wollman2002-03-221-88/+118
| | | | | | | | | | | | | - expr must conform to the Utility Syntax Guidelines, so use getopt() to eat the (non-existent) options. - Use the Standard type intmax_t for arithmetic. - If an argument cannot be *completely* converted to an integer, then it is a string. Additionally make some style cleanups near the modified lines. This utility is still not completely style-compliant.
* o __P has been reovedimp2002-02-021-85/+56
| | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o gc some #ifdef sun ... #endif code Approved by: arch@, new style(9)
* Fix warnings to compile with WARNS=2 on i386 and alphakris2001-05-261-27/+42
| | | | Reviewed by: bde
* Add overflow testsse2000-07-221-3/+76
|
* Extend numeric operations to support 64 bit numbers.se2000-07-101-30/+29
|
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fix my own brokeness for the colon operator, when one of the argumentsjoerg1995-11-181-33/+31
| | | | | was a valid integer. The actual decision between integer and string is now context-dependant on the operator being used.
* expr(1) didn't comply to Posix.2 and its own man page: anyjoerg1995-08-041-1/+13
| | | | | | | | comparisions have been made as string comparisions, even in cases where both operands clearly qualified as integers. The fix is to make the parser properly analyzing whether an operand is a valid integer or not.
* You will find enclosed some changes to make gcc -Wall more happy injoerg1995-03-191-2/+3
| | | | | | | | | /usr/src/bin. Note that some patches are still needed in that directory. I (Joerg) finished most of Philippe's cleanup. /bin/sh will still need *allot* of work, however. Submitted by: charnier@lirmm.fr (Philippe Charnier)
* Added $Id$dg1994-09-241-1/+1
|
* Explicitly include <sys/types.h> before including <regex.h>. This isbde1994-09-051-0/+1
| | | | | apparently required by POSIX. It will be required in practice when the bogus inclusion of <sys/types.h> is removed from <stdio.h>.
* Allow expressions like "expr 'ABC' : '^.*$' to work as is done in otherjtc1993-10-041-9/+3
| | | | expr implementations.
* Fix grammar to eliminate support for unary minus expressions -- theyjtc1993-09-141-9/+8
| | | | | weren't supported, they aren't standard, and they caused expr to dump core.
* 1003.2 requires that lexical comparisons be done in locale specific manner,jtc1993-08-171-34/+29
| | | | | | | so we have to use strcoll() instead of strcmp(). 1003.2 requires that a null string be returned if a string does not match a \( \) subexpression. Replaced fprintf/exit with calls to err and errx as appropriate.
* Update to my latest expr (fixes bugs with comparison and matching operators)conklin1993-07-211-42/+7
| | | | Add man page I wrote.
* added POSIX regex to expralm1993-06-191-53/+39
|
* Initial import, 0.1 + pk 0.2.4-B1rgrimes1993-06-121-0/+594
OpenPOWER on IntegriCloud