summaryrefslogtreecommitdiffstats
path: root/usr.bin/awk (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Document that rand() returns non-deterministic random numbers unless atim2020-06-171-3/+12
| | | | | | seed is explicitly set. OK millert@
* Fix strlcpy() size parameter in refldbld(), it was a byte too small.millert2020-06-162-17/+21
| | | | | While here, add proper bounds checking for the partial match case in refldbld() too and check strlcpy() return values throughout.
* Integrate the bsd-features branch from awk github.millert2020-06-138-14/+339
| | | | | Implements the gensub(), systime() and strftime() functions for greater gawk compatibility.
* POSIX doesn't permit an unescaped '/' in an extended regular expression.millert2020-06-135-21/+35
| | | | | | | | Unlike upstream awk, ours has historically allowed unescaped '/' inside a bracket expression for compatibility with other awk implementations but the check was too simple-minded. This improves the matching to allow things like /[]/]/, /[^]// and '/[abc[:digit:]/@#]/' To enable strict POSIX compliance, set POSIXLY_CORRECT.
* Use setlocale(LC_CTYPE, "") instead of setlocale(LC_ALL, "")millert2020-06-111-2/+2
| | | | This matches upstream awk and OpenBSD only implements LC_CTYPE anyway.
* Fix length parameter to strlcpy, inputFS is a pointer.millert2020-06-111-2/+2
|
* Update awk to June 5, 2020 version.millert2020-06-105-11/+35
|
* Update awk to Feb 28, 2020 version.millert2020-06-109-253/+422
|
* Update awk to Jan 31, 2020 version.millert2020-06-1011-54/+120
|
* Update awk to Jan 5, 2020 version.millert2020-06-108-132/+175
|
* Update awk to Nov 10, 2019 version.millert2020-06-1010-104/+130
|
* Update awk to Oct 24, 2019 version.millert2020-06-1011-197/+204
|
* Update awk to Oct 17, 2019 version.millert2020-06-105-110/+125
|
* Update awk to Oct 6, 2019 version.millert2020-06-106-33/+143
|
* Update awk to Sep 10, 2019 version.millert2020-06-1013-129/+196
|
* Update awk to Jun 17, 2019 version.millert2020-06-106-10/+52
|
* Update awk to March 5, 2019 version.millert2020-06-106-19/+277
|
* Update awk to Jan 25, 2019 version.millert2020-06-108-56/+113
|
* Update awk to Oct 25, 2018 version.millert2020-06-103-4/+11
| | | | | Add test in maketab.c to prevent generating a proctab entry for YYSTYPE_IS_DEFINED.
* Update awk to Aug 27, 2018 version.millert2020-06-104-13/+19
| | | | | Disallow '$' in printf formats Added some casts to silence warnings on debugging printfs.
* Update awk to Aug 23, 2018 version.millert2020-06-1011-44/+293
|
* Update awk to Jan 5, 2013 version, no real code changes.millert2020-06-103-14/+31
|
* The errcheck() function treats an errno of ERANGE or EDOM as somethingguenther2020-06-081-3/+11
| | | | | | | | | | | | to report, so make sure errno is set to zero before invoking a function to check so that a previous such errno value won't result in a false positive. This could happen simply due to input line fields that looked enough like floating-point input to trigger ERANGE. Problem noted by Jordan Geoghegan (jordan (at) geoghegan.ca), with clue from Ze' Loff (zeloff (at) zeloff.org) ok millert@
* Merge a missing fix from awk-12202012 and update the version and FIXES.millert2020-02-274-7/+25
| | | | This was the last awk release before the move to github.
* claudio noticed that "exit" inside the main {} clause still runs the EXITderaadt2020-01-221-7/+10
| | | | | | clause, this was poorly documented as "immediately", and "after the last line" which is inaccurate there are other causes. Explain this a bit better. ok millert claudio
* Check for strdup return value and exit on failure.fcambus2019-08-131-1/+3
| | | | OK millert@
* Fix a segmentation fault in awk, from upstream version 20121220.fcambus2019-08-131-3/+4
| | | | OK millert@
* use proper crossreferencesnaddy2019-05-261-3/+4
|
* POSIX requires that awk support \v and \a escapes. I used '\007'millert2018-01-242-2/+8
| | | | | for BEL since that is what lex.c uses, though we could safely use '\a' there instead. OK martijn@
* Convert snprintf+write into dprintf. It is simply easier to read, andderaadt2017-12-081-17/+9
| | | | | provides retry on short-write file descriptors. ok florian, previous versions seen by millert
* rename dprintf macro to DPRINTF to avoid collision with libc posix dprintf.deraadt2017-10-097-51/+51
| | | | | | (amazing to me that the posix name was chosen though it specifically collides with code Kernighan maintained since the V7). ok millert
* Move the assignment to cmdname up before its first use.tb2017-10-081-2/+2
| | | | | | From Ori Bernstein. ok deraadt
* Mark FATAL() as __dead so clang doesn't reportkrw2017-09-252-4/+4
| | | | | | | use of uninitialized variables after calls to FATAL(). ok millert@ guenther@
* Fix bitwise operations error messages; from FreeBSDajacoutot2017-09-151-4/+4
| | | | ok deraadt@
* remove misc. depend and yacc nits that no longer matter.espie2017-07-101-4/+2
| | | | okay millert@
* mark files as BUILDFIRST, or write explicit dependencies, so that mostespie2017-06-161-1/+3
| | | | | programs will build even without a make depend first. okay tb@ millert@
* Fix awk crash with empty assignment, e.g. 'BEGIN {i=$1}', whenmillert2016-04-121-1/+2
| | | | malloc does not return zero-filled data. OK tb@
* Remove modulo bias in random number generator.tb2015-12-161-2/+2
| | | | | | Diff from Matthew Martin, rewieved by deraadt@ and me. ok deraadt@, millert@
* Until we understand the sitaution better, we should pledge() afterderaadt2015-10-221-3/+4
| | | | setlocale(), not before. Not just here, but probably everywhere?
* 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