summaryrefslogtreecommitdiff
path: root/contrib/one-true-awk
Commit message (Collapse)AuthorAgeFilesLines
* Fix another UBSan error in awkAlex Richardson2020-09-211-2/+1
| | | | | | | | This applies my upstreamed fix: https://github.com/onetrueawk/awk/commit/ad9bd2f40a89ec9533b92254b86a756cf4f40fd4 Found By: UBSan Notes: svn path=/head/; revision=365969
* awk: Fix subobject out-of-bounds accessAlex Richardson2020-09-212-3/+3
| | | | | | | | | | | | | | | | | When matching a regex with ^, it would attempt to access gototab[NSTATES][NCHARS+2], and therefore access the state for the \002 character instead. This change is required to run awk under CHERI (with sub-object bounds) and when running with UBSan instrumentation. This was committed upstream as https://github.com/onetrueawk/awk/commit/cbf924342b63a095a4c6842280c3085b1b63ae45 Found by: CHERI (with subobject bounds enabled) Obtained from: CheriBSD Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D26509 Notes: svn path=/head/; revision=365968
* Another partial revert of r301289.Warner Losh2019-06-031-1/+1
| | | | | | | | | | | | | In this case, a change was made in one-true-awk from *FS to getsval(fsloc) in a line just after one of the lines that had the 0 -> NULL change. It works both ways as far as I can tell. It looks like a bug fix, but I've not tried to track down which ancient version of one-true-awk it was in (github starts too late for tracking this down). Before and after the changes the regression suite is passes 100% relative to the un-modified one-true-awk. Notes: svn path=/head/; revision=348527
* Fix mismerge that crept into r301289.Warner Losh2019-06-031-3/+0
| | | | | | | | | | | | | The conversion of 0 -> NULL required a rebase at some point, as noted in r301289 when pfg commited it. In that rebase, three lines remained that had been removed in a prior version of awk, and one of them had a 0 -> NULL change causing a conflict. The conflict should have been resolved by removing the three lines, but wasn't. This introduces a regression into f.split3 test which prior to this commit we were failing, but a pure onetrueawk wasn't. Remove the offending 3 lines. Notes: svn path=/head/; revision=348526
* Revert r348518Warner Losh2019-06-021-1/+1
| | | | | | | It should not have happened. The change is actually in upstream and I misread the diffs. Notes: svn path=/head/; revision=348519
* Reapply r301691:Warner Losh2019-06-021-1/+1
| | | | | | | | | | | | Revert r301689 - one-true-awk: Avoid a NULL dereference. I got this wrong and the coverity report doesn't match the NetBSD change, which was thought for a different version. The change wouldn't hurt but let's wait until upstream figures this out. Notes: svn path=/head/; revision=348518
* Reapply r315426 by pfg:Warner Losh2019-06-021-6/+6
| | | | | | | | MFV r315425: one-true-awk: have calloc(3) do the multiplication. Notes: svn path=/head/; revision=348513
* Reapply r301289 by pfg:Warner Losh2019-06-026-43/+46
| | | | | | | | | | MFV r300961: one-true-awk: replace 0 with NULL for pointers | Also remove a redundant semicolon. | Also had to rebase on upstream pull. Notes: svn path=/head/; revision=348512
* Merge from upstream at 4189ef5d from https://github.com/onetrueawk/awk.gitWarner Losh2019-06-0272-219/+1723
|\ | | | | | | | | | | | | | | | | | | | | | | Note: this backs out a number of changes we've made to awk because they aren't upstream, but are on the vendor branch. Those will be reapplied. svn makes it needlessly difficult to know which ones, but at least r315426, r301289, and maybe r301691, though there may be others too. None of these are critical, so bisecting through this point is safe for all but awk regression tests :). Notes: svn path=/head/; revision=348511
* | Update awk(1) manual to state an exception to egrep(1)-like RE syntaxDevin Teske2018-11-021-3/+7
| | | | | | | | | | | | | | | | | | | | Reviewed by: imp, jmg MFC after: 3 days Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D17739 Notes: svn path=/head/; revision=340091
* | Don't display empty error context.Warner Losh2017-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | Context extraction didn't handle this case and showed uninitialized memory. Obtained from: OpenBSD lib.c 1.21 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D12379 Notes: svn path=/head/; revision=323965
* | Fix %c for floating values that become 0 when coerced to int.Warner Losh2017-09-241-1/+1
| | | | | | | | | | | | | | | | | | Obtained from: OpenBSD run.c 1.36 (From Jeremy Devenport) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D12379 Notes: svn path=/head/; revision=323964
* | Fix uninitialized variableWarner Losh2017-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | echo | awk 'BEGIN {i=$1; print i}' prints a boatload of stack garbage. NUL terminate the memory returned from malloc to prevent it. Obtained from: OpenBSD run.c 1.40 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D12379 Notes: svn path=/head/; revision=323963
* | Implement gawk multiple-arg extension to and, or, and xor.Warner Losh2017-09-141-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | gawk allows multiple arguemnts to bit-wiste and, or and xor functions. Implement an arbitrary number of arguments for these functions. Also, use NULL in preference to 0 to match rest of file. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D12361 Notes: svn path=/head/; revision=323577
* | Bring in bit operation functions, ala gawk.Warner Losh2017-09-143-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are from OpenBSD: >>> Extend awk with bitwise operations. This is an extension to the awk >>> 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@ Edited to fix cut and paste in error messages, as well as using tabs instead of spaces after #defines added. Obtained From: OpenBSD awk.h 1.12, lex.c 1.10, run.c 1.29 Differential Revision: https://reviews.freebsd.org/D12361 Sponsored by: Netflix Notes: svn path=/head/; revision=323576
* | MFV r315425:Pedro F. Giffuni2017-03-161-6/+6
|\| | | | | | | | | | | | | | | | | one-true-awk: have calloc(3) do the multiplication. MFC after: 3 days Notes: svn path=/head/; revision=315426
* | The bug:Andrey A. Chernov2016-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The patch skips NUL as a quick fix. PR: 195792 Submitted by: kdrakehp@zoho.com Approved by: bwk@cs.princeton.edu (the author) MFC after: 3 days Notes: svn path=/head/; revision=305365
* | Back out non-collating [a-z] ranges.Andrey A. Chernov2016-07-141-4/+0
| | | | | | | | | | | | | | | | | | | | | | Instead of changing the whole course to another POSIX-permitted way for consistency and uniformity I decide to completely ignore missing regex fucntionality and focus on fixing bugs in what we have now, too many small obstacles we have choicing other way, counting ports. Corresponding libc changes are backed out in r302824. Notes: svn path=/head/; revision=302828
* | After removing collation for [a-z] ranges in r302512, do it here too.Andrey A. Chernov2016-07-131-0/+4
| | | | | | | | | | | | | | | | | | I'll try to keep the change very minimal to not touch contribed code much. I'll send it upstream when it will be merged to main branches, but we need the change right now here. Notes: svn path=/head/; revision=302742
* | Revert r301689 - one-true-awk: Avoid a NULL dereference.Pedro F. Giffuni2016-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | I got this wrong and the coverity report doesn't match the NetBSD change, which was thought for a different version. The change wouldn't hurt but let's wait until upstream figures this out. Notes: svn path=/head/; revision=301691
* | one-true-awk: Avoid a NULL dereference.Pedro F. Giffuni2016-06-081-1/+1
| | | | | | | | | | | | | | | | | | CID: 270862 Obtained from: NetBSD (CVS Rev. 1.8) MFC after: 2 weeks Notes: svn path=/head/; revision=301689
* | MFV r300961:Pedro F. Giffuni2016-06-036-43/+43
|\| | | | | | | | | | | | | | | | | one-true-awk: replace 0 with NULL for pointers Also remove a redundant semicolon. Notes: svn path=/head/; revision=301289
* | awk: Use random(3) instead of rand(3)Pedro F. Giffuni2014-09-193-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While none of them is considered even near to cryptographic level, random(3) is a better random generator than rand(3). Use random(3) for awk as is done in other systems. Thanks to Chenguang Li for discussing this in the lists and submitting the patch upstream. PR: 193147 MFC after: 5 weeks Notes: svn path=/head/; revision=271879
* | MFV: one-true-awk 20121220.Xin LI2013-01-036-10/+29
|\| | | | | | | | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=244988
* | - Merged awk upstream that includes a fix for a bug exposed by kmod_syms.mk.Ruslan Ermilov2011-08-113-3/+12
|\| | | | | | | | | | | | | | | | | - Provide a build aid for those who already have a buggy awk(1) installed. Approved by: re (kib) Notes: svn path=/head/; revision=224776
* | Update to a 7-Aug-2011 release.Ruslan Ermilov2011-08-0910-43/+98
|\| | | | | | | | | | | | | Approved by: re (kib) Notes: svn path=/head/; revision=224731
* | Update to a 6-May-2011 release (upstreamed some of our changes).Ruslan Ermilov2011-05-063-209/+7
|\| | | | | | | Notes: svn path=/head/; revision=221533
* | Update to a 1-May-2011 release (except for the isblank change).Ruslan Ermilov2011-05-037-22/+59
|\| | | | | | | Notes: svn path=/head/; revision=221381
* | Apply patches directly to sources. Their effect is as follows:Ruslan Ermilov2010-01-103-14/+50
| | | | | | | | | | | | | | | | | | | | | | - Make one-true-awk respect locale's collating order in [a-z] bracket expressions, until a more complete fix (like handing BREs) is ready. - Don't require a space between -[fv] and its argument. Notes: svn path=/head/; revision=201989
* | Update to a 26-Nov-2009 release.Ruslan Ermilov2010-01-099-8/+26
|\| | | | | | | Notes: svn path=/head/; revision=201951
| * Flatten out vendor tree.Ruslan Ermilov2010-01-0918-8108/+0
| | | | | | | | Notes: svn path=/vendor/one-true-awk/dist/; revision=201936
* | Clean up import.Ruslan Ermilov2010-01-091-73/+0
| | | | | | | | Notes: svn path=/head/; revision=201940
* | Document the bwk_20071023 import.David E. O'Brien2007-10-251-4/+4
| | | | | | | | Notes: svn path=/head/; revision=172961
* | This commit was generated by cvs2svn to compensate for changes in r172958,David E. O'Brien2007-10-253-4/+12
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=172959
| * Vendor import of bwk's 23-Oct-2007 release.David E. O'Brien2007-10-253-4/+12
| | | | | | | | | | | | | | This includes fixes for FreeBSD PR's: bin/104795, bin/100443 Notes: svn path=/vendor/one-true-awk/dist/; revision=172958
* | - Update for 2007/05/01 import.Rong-En Fan2007-06-051-2/+2
| | | | | | | | | | | | | | | | Approved by: delphij (mentor) Nodded by: ru Notes: svn path=/head/; revision=170334
* | This commit was generated by cvs2svn to compensate for changes in r170331,Rong-En Fan2007-06-0511-145/+202
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=170332
| * Vendor import of bwk's 01-May-2007 release.Rong-En Fan2007-06-0511-145/+202
| | | | | | | | | | | | | | | | | | Approved by: delphij (mentor) Nodded by: ru Tested by: make universe Notes: svn path=/vendor/one-true-awk/dist/; revision=170331
* | Update for the 2005/04/24 import.Ruslan Ermilov2005-05-161-3/+3
| | | | | | | | Notes: svn path=/head/; revision=146303
* | This commit was generated by cvs2svn to compensate for changes in r146299,Ruslan Ermilov2005-05-1611-130/+189
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=146300
| * Vendor import of bwk's 24-Apr-2005 release.Ruslan Ermilov2005-05-1611-130/+189
| | | | | | | | Notes: svn path=/vendor/one-true-awk/dist/; revision=146299
* | Update for the 2004/02/07 import.Ruslan Ermilov2004-02-081-5/+5
| | | | | | | | Notes: svn path=/head/; revision=125604
* | This commit was generated by cvs2svn to compensate for changes in r125601,Ruslan Ermilov2004-02-084-4/+39
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=125602
| * Vendor import of bwk's 7-Feb-2004 release.Ruslan Ermilov2004-02-084-4/+39
| | | | | | | | Notes: svn path=/vendor/one-true-awk/dist/; revision=125601
* | Update for the 2003/07/31 import.Ruslan Ermilov2004-02-071-2/+2
| | | | | | | | Notes: svn path=/head/; revision=125572
* | This commit was generated by cvs2svn to compensate for changes in r125505,Ruslan Ermilov2004-02-052-3/+3
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=125506
| * Fixes from 31-Jul-2003; make it 8-bit clean.Ruslan Ermilov2004-02-052-3/+3
| | | | | | | | | | | | | | Forgotten by: ru (for far too long) Notes: svn path=/vendor/one-true-awk/dist/; revision=125505
* | Update for the 2003/07/29 import.Ruslan Ermilov2003-07-301-4/+5
| | | | | | | | Notes: svn path=/head/; revision=118197
* | This commit was generated by cvs2svn to compensate for changes in r118194,Ruslan Ermilov2003-07-305-30/+60
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=118195
| * Vendor import of bwk's 29-Jul-2003 release.Ruslan Ermilov2003-07-305-30/+60
| | | | | | | | Notes: svn path=/vendor/one-true-awk/dist/; revision=118194