aboutsummaryrefslogtreecommitdiff
path: root/bin/expr
Commit message (Collapse)AuthorAgeFilesLines
* expr(1): Fix overflow detection when operand is INTMAX_MINConrad Meyer2018-04-141-4/+2
| | | | | | | | PR: 227329 Submitted by: Tobias Stoeckmann <tobias AT stoeckmann.org> Notes: svn path=/head/; revision=332499
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* Document origins of expr & authorsSevan Janiyan2016-10-051-1/+17
| | | | | | | | | | | | http://minnie.tuhs.org/cgi-bin/utree.pl?file=PWB1/usr/man/man1/expr.1 PR: 173979 Approved by: bcr (mentor) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D8104 Notes: svn path=/head/; revision=306719
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* MFHGlen Barber2016-03-101-0/+11
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+11
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | MFHGlen Barber2016-03-021-2/+0
|\| | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296318
| * DIRDEPS_BUILD: Regenerate without local dependencies.Bryan Drewery2016-02-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295989
* | Explicitly add unmarked bin/ binaries to the runtime package.Glen Barber2016-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added later. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295439
* | First pass to fix the 'tests' packages.Glen Barber2016-02-021-0/+4
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andEnji Cooper2015-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 Notes: svn path=/head/; revision=289172
* Add META_MODE support.Simon J. Gerraty2015-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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-274-8/+45
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge from headSimon J. Gerraty2013-09-051-0/+2
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+21
| | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | Pet manlintBaptiste Daroussin2015-04-261-1/+1
| | | | | | | | | | | | Notes: svn path=/head/; revision=282002
* | | Use mdoc(7) macros for curly bracesBaptiste Daroussin2015-04-261-3/+3
| | | | | | | | | | | | Notes: svn path=/head/; revision=281998
* | | Build expr with -fwrapv, since it relies on signed integer wrappingDimitry Andric2015-03-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | having defined behavior. Reported by: rodrigc MFC after: 3 days Notes: svn path=/head/; revision=280357
* | | Fix overflow check for multiplication:Stefan Eßer2015-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 Notes: svn path=/head/; revision=277798
* | | Integrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/testsEnji Cooper2015-01-192-0/+22
| |/ |/| | | | | | | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=277358
* | Add the Clang specific -Wmissing-variable-declarations to WARNS=6.Ed Schouten2013-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@ Notes: svn path=/head/; revision=249657
* Remove redundant declaration of yyparseKevin Lo2012-05-221-1/+0
| | | | | | | Reported by: tinderbox Notes: svn path=/head/; revision=235771
* Minor mdoc nits.Joel Dahl2012-05-131-1/+1
| | | | Notes: svn path=/head/; revision=235400
* rm[0].rm_so must be zero (an explicit check is made for zero in theEitan Adler2012-03-191-1/+1
| | | | | | | | | | outer if condition) Reviewed by: se Approved by: cperciva Notes: svn path=/head/; revision=233137
* Whitespace cleanup:Glen Barber2012-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 Notes: svn path=/head/; revision=232158
* Fix various typos in manual pages.Glen Barber2012-02-251-3/+3
| | | | | | | | | Submitted by: amdmi3 PR: 165431 MFC after: 1 week Notes: svn path=/head/; revision=232157
* Fix style, since this file has just been touched in a major way.Stefan Eßer2011-07-091-96/+75
| | | | | | | No actual code changes. Notes: svn path=/head/; revision=223883
* Some refactoring for easier maintenance of the code. This is a follow-upStefan Eßer2011-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. Notes: svn path=/head/; revision=223882
* Make /bin/expr support 64bit numeric range and range checks by default,Stefan Eßer2011-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) Notes: svn path=/head/; revision=223881
* expr(1): Add sh(1) versions of examples, remove an incorrect example.Jilles Tjoelker2010-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 Notes: svn path=/head/; revision=212390
* Fix markup.Ruslan Ermilov2007-03-041-5/+8
| | | | Notes: svn path=/head/; revision=167210
* Correct typos containing my login name (plus one more in expr.y).Ceri Davies2007-02-181-2/+2
| | | | | | | Found courtesy of a recursive grep in the wrong directory. Notes: svn path=/head/; revision=166813
* Add the new standard EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-161-12/+12
| | | | | | | Sort standard sections in the (documented) preferred order. Notes: svn path=/head/; revision=140353
* Removed harmful empty lines that crept in during the copyrightRuslan Ermilov2005-01-131-1/+0
| | | | | | | header update. Notes: svn path=/head/; revision=140169
* /*- or .\"- or #- to begin license clauses.Warner Losh2005-01-102-2/+4
| | | | Notes: svn path=/head/; revision=139969
* Remove BUGS section that talked about missing multibyte character support.Tim J. Robbins2004-07-121-5/+1
| | | | | | | We have support now that the regular expression routines do. Notes: svn path=/head/; revision=132029
* Document missing multibyte character handling in utilities specifiedTim J. Robbins2004-07-031-1/+5
| | | | | | | by POSIX. Notes: svn path=/head/; revision=131513
* Get this area compiling with the highest WARNS= that it works with.Mark Murray2003-06-131-2/+0
| | | | | | | | | | Obsolete WFORMAT= junk also removed where possible. OK'ed by: obrien Tested on: sparc64, alpha, i386 Notes: svn path=/head/; revision=116282
* mdoc(7) police:Ruslan Ermilov2002-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 Notes: svn path=/head/; revision=107282
* 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