summaryrefslogtreecommitdiffstats
path: root/usr.bin/awk (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add pledge support in awk and make awk -safe actually safe.doug2015-10-101-1/+17
| | | | | | | | | | | | | | awk -safe was introduced back in 1997 to stop awk from doing file output, execute commands or access the environment. The lexer rejected programs when it saw awk commands that would write, exec or env. Beyond that, it wasn't safe from write/exec/env during program execution. With pledge "stdio rpath", the kernel is now enforcing the awk -safe mode restrictions at runtime (other than env). Based on a diff by deraadt@ ok deraadt@ beck@
* Avoid .Ns right after .Pf, it's pointless.schwarze2015-09-141-5/+5
| | | | In some cases, do additional cleanup in the immediate vicinity.
* When rand() was made fully random, the return value of srand() wasderaadt2015-09-051-4/+8
| | | | | | | | | also affected incorrectly. Noticed by Stephane Chazelas. This reverts the return value of srand() to the old (not very useful) behaviour. This also allows toggling rand() to strong/weak based upon whether srand() is called without/with an argument. Long discussion and work with millert ok beck
* Don't display empty error context.tobiasu2015-03-271-2/+3
| | | | | | Context extraction didn't handle this case and showed uninitialized memory. ok tobias, miod
* fix placement of opening parentheses, and drop some .Xo while hereschwarze2015-01-161-15/+7
|
* Use reallocarray() where suitablederaadt2014-12-192-16/+22
| | | | ok millert doug
* .Xr cut which may be what you're really looking for.tedu2014-12-151-2/+3
|
* Use srandom_deterministic() if a seed is supplied, thereby switching thederaadt2014-12-081-11/+4
| | | | | | subsystem out of strong random mode. No effective change from what we've been doing for a while. Result is it becomes 1 line of code. ok millert
* Fix %c for floating values that become 0 when coerced to int.millert2014-12-011-2/+2
| | | | From Jeremy Devenport
* Userland reallocarray() audit.doug2014-10-111-2/+2
| | | | | | | Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
* as suggested by schwarze, reshuffle STANDARDS text detailing posix featuresjmc2014-03-171-6/+6
| | | | | | | we don;t support next to the posix compat blurb, in order to make things a bit clearer; this also makes the text more concise; ok millert schwarze sobrado
* use a more clearly named variable for the srandom case in the codederaadt2013-09-291-7/+7
| | | | ok millert
* Remove wrong workaround for the 88100 `awk bug' - it turns out compilingmiod2013-08-181-5/+1
| | | | | with -O2 changes the alignment of code and data, which caused the awk binary to be more prone to trigger the DAE bug which just got fixed.
* Build awk with -O1 on m88k for now; when built -O2, it would sporadicallymiod2013-07-281-1/+5
| | | | | exit early blaming a spurious '}' in the first few lines of input, but only on 88100-based systems.
* remove makefile hacks that are no longer needed with t1 t2: working properlyespie2012-12-211-6/+3
| | | | okay krw@
* Update awk to Aug 10, 2011 version; naddy@ reports no ports problemsmillert2011-09-2810-70/+167
| | | | from the update.
* no need to escape `|'; as discussed with schwartzejmc2011-05-021-3/+3
|
* Stash the old seed when srand() is called and use it as the returnmillert2011-04-201-3/+5
| | | | | value as per POSIX and the fine manual. Fix sent upstream to bwk. OK deraadt@
* some small tweaks from Michael W. Bombardieri;jmc2011-03-221-5/+5
| | | | ok sobrado
* Between groff-1.15 and groff-1.20.1, the .Ns macro was changed to noschwarze2011-02-071-5/+3
| | | | | | | longer suppress spacing when used at the beginning of an input line, and mandoc now follows the same behaviour as new groff. Thus, sweep the tree and remove useless .Ns. Most places found by jmc@; ok jmc@ kristaps@.
* more EXIT STATUS tweaks; from Daniel Dickmanjmc2010-10-011-2/+8
|
* get rid of the nawk hard linkderaadt2010-08-252-7/+3
| | | | ok millert guenther
* convert some of the weirder displays into lists, to avoid mangling;jmc2010-08-081-39/+47
|
* Update awk to May 23, 2010 version. OK miod@millert2010-06-137-16/+48
|
* remove references to docs we no longer install;jmc2010-01-101-5/+2
|
* Stop installing many of the incredibly dated and un-authoritative share/docderaadt2010-01-041-6/+1
| | | | | | | files. If any information found in these documents is worthwhile and you miss it, please make the time to work it into the manual pages (which people actually do read). ok guenther
* bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a fewjmc2009-02-081-3/+3
| | | | updates to follow;
* Update awk to version 20071023; OK deraadt@millert2008-10-069-88/+161
|
* +awk does not support {n,m} pattern matchingjmc2008-09-041-2/+5
| | | | | | noted by Vadim Zhukov, though slightly different (doc) fix committed; ok millert
* repair .Pq use; Alan R. S. Buenoderaadt2008-07-251-3/+3
|
* tweak previous, and arrange the text to read a little better;jmc2008-06-041-19/+20
|
* Extend awk with bitwise operations. This is an extension to the awkpyr2008-06-044-6/+91
| | | | | | | spec and documented as such, but comes in handy from time to time. The prototypes make it compatible with a similar GNU awk extension. ok millert@, enthusiasm from deraadt@
* Use arc4random_buf() when requesting more than a single word of outputdjm2008-04-131-2/+2
| | | | | | | Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
* fail nicely instead of crashing for format strings containing '*',deraadt2008-02-271-1/+3
| | | | | without a matching argument following from Jukka Salmi
* fix yacc/lex parallel file generationespie2007-11-241-3/+6
|
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-022-5/+5
|
* printf(1) is the correct reference here, not printf(3);jmc2007-06-271-5/+4
| | | | from otto; ok millert
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* - use a consistent text for STANDARDSjmc2007-05-301-1/+15
| | | | - note which options are extensions to POSIX
* Do not touch uninitialized variable, if sscanf(3) fails.moritz2007-04-021-2/+2
| | | | ok millert@
* allow this to build w/ cross-tools thru providing proper hostcflags; found by rainor's workmickey2007-03-181-2/+3
|
* sync the -f description w/ its synopsis;jmc2007-01-291-3/+3
|
* sync usage(); spotted by Igor Sobradojmc2007-01-291-3/+3
|
* from ru@freebsd:jmc2006-11-041-3/+3
| | | | | | Fix a bug converting a variable from the numeric type to a string. ok otto deraadt
* Handle / inside []s properly.hugh2006-04-161-3/+7
| | | | | OK by otto and millert. Offered back to bell-labs.
* - document return value of cmd | getline [var]jmc2006-03-291-4/+9
| | | | | | | - document fflush w/o arg from matthias kilian; ok otto
* more sane calloc(3) usage; from adobriyan@gmail.com, ok millertpvalchev2006-03-191-7/+7
|
* Don't try to fclose(infile) when infile == NULL. This can happenmillert2005-11-231-2/+2
| | | | when using nextfile in the BEGIN block. From Matthias Kilian.
* .Xr script 7jmc2005-05-121-2/+3
|
* Use asprint(), not snprintf() when converting strings to numbersmillert2005-04-151-5/+6
| | | | | | | since CONVFMT is user-settable (hence we can't know the actual buffer size requirements) and we need to store a dynamic copy of the result anyway. Fixes a truncation issue with weird CONVFMT values and closes PR 4172 (Matthias Kilian).