summaryrefslogtreecommitdiffstats
path: root/bin/expr
Commit message (Collapse)AuthorAgeFilesLines
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andngie2015-10-121-6/+0
| | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison
* Add META_MODE support.sjg2015-06-131-0/+21
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+1
| |
| * Merge sync of headsjg2015-05-274-8/+45
| |\ | |/ |/|
| * Updated dependenciessjg2014-05-161-1/+0
| |
| * Updated dependenciessjg2014-05-101-0/+2
| |
| * Merge from headsjg2013-09-051-0/+2
| |\
| * | Updated dependenciessjg2013-03-111-0/+1
| | |
| * | Updated dependenciessjg2013-02-161-2/+0
| | |
| * | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+21
| | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | Pet manlintbapt2015-04-261-1/+1
| | |
* | | Use mdoc(7) macros for curly bracesbapt2015-04-261-3/+3
| | |
* | | Build expr with -fwrapv, since it relies on signed integer wrappingdim2015-03-221-0/+3
| | | | | | | | | | | | | | | | | | | | | having defined behavior. Reported by: rodrigc MFC after: 3 days
* | | Fix overflow check for multiplication:se2015-01-271-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add special test to detect the case of -1 * INTMAX_MIN - Protect against elimination of the test division by the optimizer Garrett Cooper noticed that the overflow checks were incomplete, and Bruce Evans suggested the use of the "volatile" qualifier to counter the effect of the undefined behaviour, when the prior multiplication caused overflow, and he also suggested improvements to the comments. Reviewed by: bde MFC after: 1 week
* | | Integrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/testsngie2015-01-192-0/+22
| |/ |/| | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* | Add the Clang specific -Wmissing-variable-declarations to WARNS=6.ed2013-04-191-0/+2
|/ | | | | | | | | | | | | This compiler flag enforces that that people either mark variables static or use an external declarations for the variable, similar to how -Wmissing-prototypes works for functions. Due to the fact that Yacc/Lex generate code that cannot trivially be changed to not warn because of this (lots of yy* variables), add a NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this specific compiler warning. Announced on: toolchain@
* Remove redundant declaration of yyparsekevlo2012-05-221-1/+0
| | | | Reported by: tinderbox
* Minor mdoc nits.joel2012-05-131-1/+1
|
* rm[0].rm_so must be zero (an explicit check is made for zero in theeadler2012-03-191-1/+1
| | | | | | | outer if condition) Reviewed by: se Approved by: cperciva
* Whitespace cleanup:gjb2012-02-251-2/+4
| | | | | | | | | o Wrap sentences on to new lines o Cleanup trailing whitespace Found with: textproc/igor MFC after: 1 week X-MFC-With: r232157
* Fix various typos in manual pages.gjb2012-02-251-3/+3
| | | | | | Submitted by: amdmi3 PR: 165431 MFC after: 1 week
* Fix style, since this file has just been touched in a major way.se2011-07-091-96/+75
| | | | No actual code changes.
* Some refactoring for easier maintenance of the code. This is a follow-upse2011-07-091-146/+69
| | | | | | to re-establishment of 64bit arithmetic, but is committed separately, to not obscure that conversion. This commit does not change the observed behaviour of expr in any way. Style will be fixed in a follow-up commit.
* Make /bin/expr support 64bit numeric range and range checks by default,se2011-07-092-140/+152
| | | | | | | | | | | | | | | | | | | | | | | | again. This brings back the behaviour of expr in FreeBSD-4, which had been reverted due to an assumed incompatbility with POSIX.1 for FreeBSD-5. This issue has been discussed in the freebsd-standards list, and the consensus was, that POSIX.1 is in fact not violated by this extension, since it affects only cases of POSIX undefined behaviour (overflow of signed long). Other operating systems did upgrade their versions of expr to support 64bit range, after it had been initially brought to FreeBSD. They have used it for a decade without problems, meanwhile. The -e option is retained, but it will only select less strict checking of numeric parameters (leading white-space, leading "+" are allowed and skipped, an empty string is considered to represent 0 in numeric context.) The call of check_utility_compat() as a means of establishing backwards compatibility with FreeBSD-4 is considered obsolete, but preserved in this commit. It is expected to be removed in a later revision of this file. Reviewed by: bde, das, jilles MFC after: 2 month (those parts that do not violate POLA)
* expr(1): Add sh(1) versions of examples, remove an incorrect example.jilles2010-09-091-10/+21
| | | | | | | | | | The three examples are better done using sh(1) itself these days. The example expr -- "$a" : ".*" is incorrect in the general case, as "$a" may be an operator. MFC after: 2 weeks
* Fix markup.ru2007-03-041-5/+8
|
* Correct typos containing my login name (plus one more in expr.y).ceri2007-02-181-2/+2
| | | | Found courtesy of a recursive grep in the wrong directory.
* Add the new standard EXIT STATUS section where appropriate.ru2005-01-161-12/+12
| | | | Sort standard sections in the (documented) preferred order.
* Removed harmful empty lines that crept in during the copyrightru2005-01-131-1/+0
| | | | header update.
* /*- or .\"- or #- to begin license clauses.imp2005-01-102-2/+4
|
* Remove BUGS section that talked about missing multibyte character support.tjr2004-07-121-5/+1
| | | | We have support now that the regular expression routines do.
* Document missing multibyte character handling in utilities specifiedtjr2004-07-031-1/+5
| | | | by POSIX.
* Get this area compiling with the highest WARNS= that it works with.markm2003-06-131-2/+0
| | | | | | | Obsolete WFORMAT= junk also removed where possible. OK'ed by: obrien Tested on: sparc64, alpha, i386
* mdoc(7) police:ru2002-11-261-1/+1
| | | | | | | | Revert to using the .Tn POSIX and .Tn ANSI instead of \*[Px] and \*[Ai] strings; using these strings is unsafe in troff mode, as they include a change in a font size. Approved by: re
* mdoc(7) police: markup fixes.ru2002-11-251-3/+3
| | | | Approved by: re
* Create a small library function, check_utility_compat(3), to determinewollman2002-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.
* mdoc(7) police: markup nits.ru2002-05-291-11/+11
|
* EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,wollman2002-05-112-1/+18
| | | | and -e reflects the historic behavior of FreeBSD's expr.
* The response to my POSIX interpretation request says that `expr'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.
* Provide an environment variabloe, EXPR_COMPAT, which disables optionwollman2002-04-222-10/+27
| | | | parsing for compatibility with old implementations.
* Disable -Werror when building -- the old version of gcc used on IA32 can'twollman2002-03-231-0/+2
| | | | deal with C99 formats.
* Typo (if => of).wollman2002-03-221-1/+1
|
* Add a word of caution about integer arithmetic range and overflow detection.wollman2002-03-221-0/+6
|
* Fix a few formatting brainos and make the formatting of the EXAMPLESwollman2002-03-221-6/+9
| | | | section somewhat clearer.
* Make expr POSIX-compliant, and fix some bugs. Specifically: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.
* 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)
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyobrien2001-12-041-1/+0
| | | | | | set WARNS=0. Reviewed by: mike
* Remove whitespace at EOL.dd2001-07-151-14/+14
|
* Fix warnings to compile with WARNS=2 on i386 and alphakris2001-05-262-27/+43
| | | | Reviewed by: bde
* Prepare for mdoc(7)NG.ru2000-12-151-1/+1
|
OpenPOWER on IntegriCloud