OpenBSD CVS

CVS log for src/usr.bin/awk/b.c


[BACK] Up to [local] / src / usr.bin / awk

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.52 / (download) - annotate - [select for diffs], Sat May 4 22:59:21 2024 UTC (2 weeks ago) by millert
Branch: MAIN
CVS Tags: HEAD
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored)

Update awk to the May 4, 2024 version.
Fixes a use-after-free bug with ARGV for "delete ARGV".

Revision 1.51 / (download) - annotate - [select for diffs], Thu Apr 25 18:33:53 2024 UTC (3 weeks, 2 days ago) by millert
Branch: MAIN
Changes since 1.50: +24 -18 lines
Diff to previous 1.50 (colored)

Update awk to the Apr 22, 2024 version.

 * fixed regex engine gototab reallocation issue that was introduced
   during the Nov 24 rewrite.

 * fixed use-after-free bug in fnematch due to adjbuf invalidating
   the pointers to buf.

Revision 1.50 / (download) - annotate - [select for diffs], Thu Jan 25 16:40:51 2024 UTC (3 months, 3 weeks ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.49: +14 -16 lines
Diff to previous 1.49 (colored)

Update awk to the Jan 22, 2024 version.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Nov 25 16:31:33 2023 UTC (5 months, 3 weeks ago) by millert
Branch: MAIN
Changes since 1.48: +102 -32 lines
Diff to previous 1.48 (colored)

Update awk to the Nov 24, 2023 version.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Nov 22 01:01:21 2023 UTC (5 months, 3 weeks ago) by millert
Branch: MAIN
Changes since 1.47: +57 -93 lines
Diff to previous 1.47 (colored)

Update awk to the Nov 20, 2023 version.

This includes a rewrite of the fnematch() function as well as a
refactoring of the sub and gsub implementation.

Revision 1.47 / (download) - annotate - [select for diffs], Wed Nov 15 18:56:53 2023 UTC (6 months ago) by millert
Branch: MAIN
Changes since 1.46: +5 -8 lines
Diff to previous 1.46 (colored)

fnematch: fix a bug that could result in extra chars being pushed back.

From Arnold Robbins.  https://github.com/onetrueawk/awk/pull/213

Revision 1.46 / (download) - annotate - [select for diffs], Wed Nov 15 18:48:13 2023 UTC (6 months ago) by millert
Branch: MAIN
Changes since 1.45: +8 -6 lines
Diff to previous 1.45 (colored)

fnematch: fix out-of-bounds access on EOF

fnematch() expects to store a NUL byte when EOF is encountered.
However, the rewrite broke this assumption because r.len from getrune()
is zero on EOF.  This results in j becoming negative on EOF, causing an
out-of-bounds access.  It is simplest to just force r.len to 1 on EOF
to copy a single NUL byte--the rune is initialized to zero even for EOF.

This also fixes the call to adjbuf().  We cannot use 'k' to determine
when we need to expand the buffer now that we are potentially reading
more than a single byte at a time.

https://github.com/onetrueawk/awk/pull/211

Revision 1.45 / (download) - annotate - [select for diffs], Mon Oct 30 17:52:54 2023 UTC (6 months, 2 weeks ago) by millert
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

Minor cosmetic changes to make our awk match my github branch.

Revision 1.44 / (download) - annotate - [select for diffs], Fri Oct 6 22:31:21 2023 UTC (7 months, 1 week ago) by millert
Branch: MAIN
Changes since 1.43: +8 -5 lines
Diff to previous 1.43 (colored)

Correctly reset the goto table for a state.

We cannot use set_gototab() to reset all the entries for a state,
it will leave existing entries as-is.  Add a new reset_gototab()
function that zeroes the table entries for the specified state.
There is no need to reset the goto table immediately after
resize_state(), it is already initialized via calloc().
Fixes https://github.com/onetrueawk/awk/issues/199

Revision 1.43 / (download) - annotate - [select for diffs], Fri Oct 6 22:29:24 2023 UTC (7 months, 1 week ago) by millert
Branch: MAIN
Changes since 1.42: +72 -46 lines
Diff to previous 1.42 (colored)

Update awk to Sep 24, 2023 version.

fnematch and getrune have been overhauled to solve issues around
unicode FS and RS. also fixed gsub null match issue with unicode.
big thanks to Arnold Robbins.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Sep 21 17:19:06 2023 UTC (7 months, 4 weeks ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored)

Fix a potential out-of-bounds read caused by the big-endian fix.

We must store a UTF-32 empty string, not UTF-8 empty string, for
an empty CCL.  Found running the awk test suite with address sanitizer.

Revision 1.41 / (download) - annotate - [select for diffs], Tue Sep 19 01:14:05 2023 UTC (8 months ago) by millert
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Compare int value against 0, not '\0', for consistency.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Sep 18 23:33:21 2023 UTC (8 months ago) by millert
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

Fix a bad cast to char * that causes incorrect results on big endian.

Now that awk stores chars as int we need to cast the Node * to int *.

Revision 1.39 / (download) - annotate - [select for diffs], Mon Sep 18 19:32:19 2023 UTC (8 months ago) by millert
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

Disable utf-8 for non-multibyte locales, such as C or POSIX.

This makes it possible to get the old awk behavior (where chars are
bytes) by setting LC_CTYPE to C or POSIX.  OK schwarze@

Revision 1.38 / (download) - annotate - [select for diffs], Sun Sep 17 14:49:44 2023 UTC (8 months ago) by millert
Branch: MAIN
Changes since 1.37: +214 -55 lines
Diff to previous 1.37 (colored)

Update to the One True Awk, 2nd edition (Sep 12, 2023).

This corresponds to the 2nd edition of "The AWK Programming Language"
and adds support for UTF-8 and comma-separated value inputs.

Revision 1.37 / (download) - annotate - [select for diffs], Thu Jul 8 21:26:39 2021 UTC (2 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Avoid a potential buffer overflow in backslash escaping.
https://github.com/onetrueawk/awk/issues/121

Revision 1.36 / (download) - annotate - [select for diffs], Tue Mar 2 20:41:42 2021 UTC (3 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.35: +4 -7 lines
Diff to previous 1.35 (colored)

Fix size computation in replace_repeat() for special_case REPEAT_WITH_Q.
This resulted in the NUL terminator being written to the end of the
buffer which was not the same as the end of the string.  That in
turn caused garbage bytes from malloc() to be processed.  Also
change the NUL termination to be less error prone by writing the
NUL immediately after the last byte copied.  OK sthen@

Revision 1.35 / (download) - annotate - [select for diffs], Wed Dec 9 20:00:11 2020 UTC (3 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.34: +21 -19 lines
Diff to previous 1.34 (colored)

Update awk to December 8, 2020 version.
Prevents strings beginning with "inf" or "nan" from being interpreted
as infinity or not-a-number respectively which still parsing "inf"
and "nan" (with or without a leading sign) correctly.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jul 30 17:45:44 2020 UTC (3 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Update awk to July 30, 2020 version.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Jul 13 14:03:52 2020 UTC (3 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Cast to uschar when storing a char in an int that will be used as an index.
Fixed as crash reported by Jan Stary when the input char has the high
bit set and FS is a regex.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jun 26 15:57:39 2020 UTC (3 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.31: +9 -3 lines
Diff to previous 1.31 (colored)

Update awk to June 25, 2020 version.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Jun 10 21:05:02 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.30: +15 -5 lines
Diff to previous 1.30 (colored)

Update awk to Jan 31, 2020 version.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Jun 10 21:04:40 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.29: +24 -19 lines
Diff to previous 1.29 (colored)

Update awk to Jan 5, 2020 version.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jun 10 21:03:56 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.28: +21 -19 lines
Diff to previous 1.28 (colored)

Update awk to Nov 10, 2019 version.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Jun 10 21:03:36 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.27: +35 -35 lines
Diff to previous 1.27 (colored)

Update awk to Oct 24, 2019 version.

Revision 1.27 / (download) - annotate - [select for diffs], Wed Jun 10 21:03:12 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.26: +111 -100 lines
Diff to previous 1.26 (colored)

Update awk to Oct 17, 2019 version.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jun 10 21:02:53 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.25: +90 -2 lines
Diff to previous 1.25 (colored)

Update awk to Oct 6, 2019 version.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jun 10 21:02:33 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.24: +17 -19 lines
Diff to previous 1.24 (colored)

Update awk to Sep 10, 2019 version.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Jun 10 21:02:19 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.23: +12 -2 lines
Diff to previous 1.23 (colored)

Update awk to Jun 17, 2019 version.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Jun 10 21:01:50 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.22: +247 -4 lines
Diff to previous 1.22 (colored)

Update awk to March 5, 2019 version.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jun 10 21:01:32 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.21: +10 -2 lines
Diff to previous 1.21 (colored)

Update awk to Jan 25, 2019 version.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jun 10 21:00:01 2020 UTC (3 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Update awk to Aug 23, 2018 version.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jan 24 16:28:25 2018 UTC (6 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.19: +5 -1 lines
Diff to previous 1.19 (colored)

POSIX requires that awk support \v and \a escapes.  I used '\007'
for BEL since that is what lex.c uses, though we could safely use
'\a' there instead.  OK martijn@

Revision 1.19 / (download) - annotate - [select for diffs], Mon Oct 9 14:51:31 2017 UTC (6 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

rename dprintf macro to DPRINTF to avoid collision with libc posix dprintf.
(amazing to me that the posix name was chosen though it specifically
collides with code Kernighan maintained since the V7).
ok millert

Revision 1.18 / (download) - annotate - [select for diffs], Fri Dec 19 19:28:55 2014 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.17: +19 -13 lines
Diff to previous 1.17 (colored)

Use reallocarray() where suitable
ok millert doug

Revision 1.17 / (download) - annotate - [select for diffs], Wed Sep 28 19:27:18 2011 UTC (12 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.16: +13 -9 lines
Diff to previous 1.16 (colored)

Update awk to Aug 10, 2011 version; naddy@ reports no ports problems
from the update.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jun 13 17:58:19 2010 UTC (13 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Update awk to May 23, 2010 version.  OK miod@

Revision 1.15 / (download) - annotate - [select for diffs], Mon Oct 6 20:38:33 2008 UTC (15 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.14: +28 -14 lines
Diff to previous 1.14 (colored)

Update awk to version 20071023; OK deraadt@

Revision 1.14 / (download) - annotate - [select for diffs], Sun Sep 2 15:19:31 2007 UTC (16 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg

Revision 1.13 / (download) - annotate - [select for diffs], Sun Mar 19 18:17:11 2006 UTC (18 years, 2 months ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.12: +7 -7 lines
Diff to previous 1.12 (colored)

more sane calloc(3) usage; from adobriyan@gmail.com, ok millert

Revision 1.12 / (download) - annotate - [select for diffs], Thu Dec 30 01:52:48 2004 UTC (19 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.11: +59 -22 lines
Diff to previous 1.11 (colored)

Update to version 20041222; OK deraadt@

Revision 1.11 / (download) - annotate - [select for diffs], Thu Dec 19 21:24:28 2002 UTC (21 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.10: +60 -13 lines
Diff to previous 1.10 (colored)

Update to the One True Awk version 20021213

Revision 1.10 / (download) - annotate - [select for diffs], Sat Sep 8 00:12:40 2001 UTC (22 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1, OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.9: +37 -34 lines
Diff to previous 1.9 (colored)

Update to latest version of the One True Awk.  See the FIXES file
for details.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jul 12 05:16:53 2001 UTC (22 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +5 -3 lines
Diff to previous 1.8 (colored)

first pass at a -Wall cleanup

Revision 1.8 / (download) - annotate - [select for diffs], Wed Dec 8 23:09:45 1999 UTC (24 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.7: +19 -19 lines
Diff to previous 1.7 (colored)

June 6, 1999 version of the "one true awk"
Most of the changes are to avoid using a static buffer for error messages.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Apr 20 17:31:29 1999 UTC (25 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.6: +13 -14 lines
Diff to previous 1.6 (colored)

April 16, 1999 version of the "one true awk"--64-bit fixes and more.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Apr 18 17:06:30 1999 UTC (25 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.5: +5 -4 lines
Diff to previous 1.5 (colored)

March 5, 1999 version of the "one true awk"

Revision 1.5 / (download) - annotate - [select for diffs], Mon Aug 25 16:17:10 1997 UTC (26 years, 9 months ago) by kstailey
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.4: +53 -44 lines
Diff to previous 1.4 (colored)

August 1997 version of "the one true awk"

Revision 1.4 / (download) - annotate - [select for diffs], Mon Apr 7 15:59:55 1997 UTC (27 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.3: +17 -18 lines
Diff to previous 1.3 (colored)

Back out last changes for now.  They cause problems.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Apr 6 06:31:48 1997 UTC (27 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.2: +18 -17 lines
Diff to previous 1.2 (colored)

Use long, not int when casting pointers and storing as integers.
Now compiles on alpha w/o warnings.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jan 20 19:43:20 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.1: +4 -3 lines
Diff to previous 1.1 (colored)

Latest research awk from June 29, 1996

Revision 1.1 / (download) - annotate - [select for diffs], Thu Jul 4 20:34:41 1996 UTC (27 years, 10 months ago) by tholo
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0

AT&T awk, by B. W. Kernighan, with fixes from 4.4BSD and by me

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.