aboutsummaryrefslogtreecommitdiff
path: root/bin/expr
Commit message (Collapse)AuthorAgeFilesLines
* mdoc(7) police: markup fixes.Ruslan Ermilov2002-11-251-3/+3
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107226
* Create a small library function, check_utility_compat(3), to determineGarrett Wollman2002-10-282-32/+34
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=106065
* mdoc(7) police: markup nits.Ruslan Ermilov2002-05-291-11/+11
| | | | Notes: svn path=/head/; revision=97464
* EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,Garrett Wollman2002-05-112-1/+18
| | | | | | | and -e reflects the historic behavior of FreeBSD's expr. Notes: svn path=/head/; revision=96382
* The response to my POSIX interpretation request says that `expr'Garrett Wollman2002-05-102-46/+88
| | | | | | | | | 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. Notes: svn path=/head/; revision=96367
* Provide an environment variabloe, EXPR_COMPAT, which disables optionGarrett Wollman2002-04-222-10/+27
| | | | | | | parsing for compatibility with old implementations. Notes: svn path=/head/; revision=95278
* Disable -Werror when building -- the old version of gcc used on IA32 can'tGarrett Wollman2002-03-231-0/+2
| | | | | | | deal with C99 formats. Notes: svn path=/head/; revision=92997
* Typo (if => of).Garrett Wollman2002-03-221-1/+1
| | | | Notes: svn path=/head/; revision=92984
* Add a word of caution about integer arithmetic range and overflow detection.Garrett Wollman2002-03-221-0/+6
| | | | Notes: svn path=/head/; revision=92983
* Fix a few formatting brainos and make the formatting of the EXAMPLESGarrett Wollman2002-03-221-6/+9
| | | | | | | section somewhat clearer. Notes: svn path=/head/; revision=92982
* Make expr POSIX-compliant, and fix some bugs. Specifically:Garrett Wollman2002-03-222-104/+215
| | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=92979
* o __P has been reovedWarner Losh2002-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) Notes: svn path=/head/; revision=90109
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyDavid E. O'Brien2001-12-041-1/+0
| | | | | | | | | set WARNS=0. Reviewed by: mike Notes: svn path=/head/; revision=87323
* Remove whitespace at EOL.Dima Dorfman2001-07-151-14/+14
| | | | Notes: svn path=/head/; revision=79754
* Fix warnings to compile with WARNS=2 on i386 and alphaKris Kennaway2001-05-262-27/+43
| | | | | | | Reviewed by: bde Notes: svn path=/head/; revision=77244
* Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-151-1/+1
| | | | Notes: svn path=/head/; revision=70056
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-1/+1
| | | | Notes: svn path=/head/; revision=68935
* Add overflow testsStefan Eßer2000-07-221-3/+76
| | | | Notes: svn path=/head/; revision=63755
* Extend numeric operations to support 64 bit numbers.Stefan Eßer2000-07-101-30/+29
| | | | Notes: svn path=/head/; revision=62926
* $Id$ -> $FreeBSD$Peter Wemm1999-08-273-3/+3
| | | | Notes: svn path=/head/; revision=50471
* Add cross-references to test(1) and expr(1) respectively.Joseph Koshy1998-12-181-1/+4
| | | | | | | | PR: docs/9111 Submitted by: Josh Gilliam <josh@quick.net> Notes: svn path=/head/; revision=41915
* Correct use of .Nm.Philippe Charnier1998-05-131-11/+11
| | | | Notes: svn path=/head/; revision=36011
* Simplified using new yacc rules and by not generating y.tab.h.Bruce Evans1998-05-041-10/+4
| | | | Notes: svn path=/head/; revision=35702
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-223-3/+3
| | | | Notes: svn path=/head/; revision=22988
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-143-3/+3
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=21673
* Backout yacc changesPoul-Henning Kamp1996-06-021-2/+6
| | | | Notes: svn path=/head/; revision=16069
* Use default yacc rule.Poul-Henning Kamp1996-05-301-7/+3
| | | | Notes: svn path=/head/; revision=16012
* ``mv'' -> ``mv -f''Wolfram Schneider1996-05-071-2/+2
| | | | | | | | ``rm'' -> ``rm -f'' so mv/rm may not ask for confirmation if you are not root Notes: svn path=/head/; revision=15679
* Fix some spelling errors.Mike Pritchard1996-01-291-5/+5
| | | | Notes: svn path=/head/; revision=13719
* Fix my own brokeness for the colon operator, when one of the argumentsJoerg Wunsch1995-11-181-33/+31
| | | | | | | | was a valid integer. The actual decision between integer and string is now context-dependant on the operator being used. Notes: svn path=/head/; revision=12378
* expr(1) didn't comply to Posix.2 and its own man page: anyJoerg Wunsch1995-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. Notes: svn path=/head/; revision=9909
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | | | | Reviewed by: phk Notes: svn path=/head/; revision=8855
* You will find enclosed some changes to make gcc -Wall more happy inJoerg Wunsch1995-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) Notes: svn path=/head/; revision=7165
* Added $Id$David Greenman1994-09-242-1/+2
| | | | Notes: svn path=/head/; revision=3044
* Explicitly include <sys/types.h> before including <regex.h>. This isBruce Evans1994-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>. Notes: svn path=/head/; revision=2502
* Fix gross spelling and typographical errors pointed out by Keith Bostic.Jordan K. Hubbard1994-04-241-2/+2
| | | | Notes: svn path=/head/; revision=1411
* Take -lgnuregex back out. Linking with it causes 'make install' to fail.Rich Murphey1994-02-031-2/+0
| | | | Notes: svn path=/head/; revision=1078
* Document the new, less restrictive, behavior of the matching operator.J.T. Conklin1993-10-041-14/+15
| | | | Notes: svn path=/head/; revision=540
* Allow expressions like "expr 'ABC' : '^.*$' to work as is done in otherJ.T. Conklin1993-10-041-9/+3
| | | | | | | expr implementations. Notes: svn path=/head/; revision=539
* Fix grammar to eliminate support for unary minus expressions -- theyJ.T. Conklin1993-09-141-9/+8
| | | | | | | | weren't supported, they aren't standard, and they caused expr to dump core. Notes: svn path=/head/; revision=468
* 1003.2 requires that lexical comparisons be done in locale specific manner,J.T. Conklin1993-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. Notes: svn path=/head/; revision=295
* Remove GNU regex.[ch] and use system's regex library. The library is stillJ.T. Conklin1993-08-021-2/+3
| | | | | | | | GNU regex for now, but will be replaced as soon as an alternative is made availiable. Notes: svn path=/head/; revision=230
* install new manual pageJ.T. Conklin1993-07-211-1/+0
| | | | Notes: svn path=/head/; revision=182
* Update to my latest expr (fixes bugs with comparison and matching operators)J.T. Conklin1993-07-212-42/+138
| | | | | | | Add man page I wrote. Notes: svn path=/head/; revision=181
* added POSIX regex to exprAndrew Moore1993-06-192-66/+46
| | | | Notes: svn path=/head/; revision=31
* Initial import, 0.1 + pk 0.2.4-B1Rodney W. Grimes1993-06-122-0/+614
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=4