xref: /freebsd/contrib/one-true-awk/FIXES (revision b45a181a74c816cfc553e8210954916887fb94dc)
12a55deb1SDavid E. O'Brien/****************************************************************
22a55deb1SDavid E. O'BrienCopyright (C) Lucent Technologies 1997
32a55deb1SDavid E. O'BrienAll Rights Reserved
42a55deb1SDavid E. O'Brien
52a55deb1SDavid E. O'BrienPermission to use, copy, modify, and distribute this software and
62a55deb1SDavid E. O'Brienits documentation for any purpose and without fee is hereby
72a55deb1SDavid E. O'Briengranted, provided that the above copyright notice appear in all
82a55deb1SDavid E. O'Briencopies and that both that the copyright notice and this
92a55deb1SDavid E. O'Brienpermission notice and warranty disclaimer appear in supporting
102a55deb1SDavid E. O'Briendocumentation, and that the name Lucent Technologies or any of
112a55deb1SDavid E. O'Brienits entities not be used in advertising or publicity pertaining
122a55deb1SDavid E. O'Briento distribution of the software without specific, written prior
132a55deb1SDavid E. O'Brienpermission.
142a55deb1SDavid E. O'Brien
152a55deb1SDavid E. O'BrienLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
162a55deb1SDavid E. O'BrienINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
172a55deb1SDavid E. O'BrienIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
182a55deb1SDavid E. O'BrienSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
192a55deb1SDavid E. O'BrienWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
202a55deb1SDavid E. O'BrienIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
212a55deb1SDavid E. O'BrienARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
222a55deb1SDavid E. O'BrienTHIS SOFTWARE.
232a55deb1SDavid E. O'Brien****************************************************************/
242a55deb1SDavid E. O'Brien
25f32a6403SWarner LoshThis file lists all bug fixes, changes, etc., made since the
26f32a6403SWarner Loshsecond edition of the AWK book was published in September 2023.
272a55deb1SDavid E. O'Brien
28*b45a181aSWarner LoshAug 04, 2025
29*b45a181aSWarner Losh	Fix incorrect divisor in rand() - it was returning
30*b45a181aSWarner Losh	even random numbers only. Thanks to Ozan Yigit.
31*b45a181aSWarner Losh
32*b45a181aSWarner Losh	Fix a syntax issue with /= that caused constants to
33*b45a181aSWarner Losh	turn into variables [eg. 42 /= 7]. Thanks to Arnold
34*b45a181aSWarner Losh	Robbins.
35*b45a181aSWarner Losh
36dd78d987SWarner LoshJan 14, 2025
37dd78d987SWarner Losh	Fix incorrect error line number issues. unput has
38dd78d987SWarner Losh	no business managing lineno. Thanks to Ozan Yigit.
39dd78d987SWarner Losh
40dd78d987SWarner LoshJan 05, 2025
41dd78d987SWarner Losh	Fix hex detection in is_valid_number.
42dd78d987SWarner Losh	Fix indirect field specification with non-numeric string
43dd78d987SWarner Losh	eg. $("foo") in indirect. This is not illegal.
44dd78d987SWarner Losh	Thanks to Arnold Robbins.
45dd78d987SWarner Losh
46dd78d987SWarner LoshJan 01, 2025
47dd78d987SWarner Losh	Fixed openfile to not try to read from a directory.
48dd78d987SWarner Losh	Thanks to Arnold Robbins.
49dd78d987SWarner Losh
508d457988SWarner LoshJul 28, 2024
518d457988SWarner Losh	Fixed readcsvrec resize segfault when reading csv records longer
528d457988SWarner Losh	than 8k. Thanks to Ozan Yigit.
538d457988SWarner Losh	mktime() added to bsd-features branch. Thanks to Todd Miller.
548d457988SWarner Losh
5517853db4SWarner LoshJun 23, 2024
5617853db4SWarner Losh	Fix signal for system-status test. Thanks to Tim van der Molen.
5717853db4SWarner Losh	Rewrite if-else chain as switch. Thanks to Andrew Sukach.
5817853db4SWarner Losh
5917853db4SWarner LoshMay 27, 2024
6017853db4SWarner Losh	Spelling fixes and removal of unneeded prototypes and extern.
6117853db4SWarner Losh	Thanks to Jonathan Gray.
6217853db4SWarner Losh
6317853db4SWarner LoshMay 4, 2024
6417853db4SWarner Losh	Fixed a use-after-free bug with ARGV for "delete ARGV".
6517853db4SWarner Losh	Also ENVtab is no longer global. Thanks to Benjamin Sturz
6617853db4SWarner Losh	for spotting the ARGV issue and	Todd Miller for the fix.
6717853db4SWarner Losh
6817853db4SWarner LoshMay 3, 2024:
6917853db4SWarner Losh	Remove warnings when compiling with g++. Thanks to Arnold Robbins.
7017853db4SWarner Losh
711023317aSWarner LoshApr 22, 2024:
7217853db4SWarner Losh	Fixed regex engine gototab reallocation issue that was
7317853db4SWarner Losh	Introduced during the Nov 24 rewrite. Thanks to Arnold Robbins.
741023317aSWarner Losh	Fixed a scan bug in split in the case the separator is a single
7517853db4SWarner Losh	character. Thanks to Oguz Ismail for spotting the issue.
761023317aSWarner Losh
771023317aSWarner LoshMar 10, 2024:
7817853db4SWarner Losh	Fixed use-after-free bug in fnematch due to adjbuf invalidating
7917853db4SWarner Losh	the pointers to buf. Thanks to github user caffe3 for spotting
801023317aSWarner Losh	the issue and providing a fix, and to Miguel Pineiro Jr.
811023317aSWarner Losh	for the alternative fix.
821023317aSWarner Losh	MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max.
831023317aSWarner Losh	thanks to Miguel Pineiro Jr.
841023317aSWarner Losh
85f32a6403SWarner LoshJan 22, 2024:
86f32a6403SWarner Losh	Restore the ability to compile with g++. Thanks to
87b2376a5fSWarner Losh	Arnold Robbins.
88f39dd6a9SWarner Losh
89f32a6403SWarner LoshDec 24, 2023:
90f32a6403SWarner Losh	Matchop dereference after free problem fix when the first
91f32a6403SWarner Losh	argument is a function call. Thanks to Oguz Ismail Uysal.
92f32a6403SWarner Losh	Fix inconsistent handling of --csv and FS set in the
93f32a6403SWarner Losh	command line. Thanks to Wilbert van der Poel.
94f32a6403SWarner Losh	Casting changes to int for is* functions.
95f39dd6a9SWarner Losh
96f32a6403SWarner LoshNov 27, 2023:
97f32a6403SWarner Losh	Fix exit status of system on MacOS. Update to REGRESS.
98b2376a5fSWarner Losh	Thanks to Arnold Robbins.
99f32a6403SWarner Losh	Fix inconsistent handling of -F and --csv, and loss of csv
100f32a6403SWarner Losh	mode when FS is set.
101b2376a5fSWarner Losh
102f32a6403SWarner LoshNov 24, 2023:
103f32a6403SWarner Losh        Fix issue #199: gototab improvements to dynamically resize the
104f32a6403SWarner Losh        table, qsort and bsearch to improve the lookup speed as the
105f32a6403SWarner Losh        table gets larger for multibyte input. Thanks to Arnold Robbins.
106b2376a5fSWarner Losh
107f32a6403SWarner LoshNov 23, 2023:
108f32a6403SWarner Losh	Fix Issue #169, related to escape sequences in strings.
109f32a6403SWarner Losh	Thanks to Github user rajeevvp.
110f32a6403SWarner Losh	Fix Issue #147, reported by Github user drawkula, and fixed
111f32a6403SWarner Losh	by Miguel Pineiro Jr.
112b2376a5fSWarner Losh
113f32a6403SWarner LoshNov 20, 2023:
114f32a6403SWarner Losh	Rewrite of fnematch to fix a number of issues, including
115f32a6403SWarner Losh	extraneous output, out-of-bounds access, number of bytes
116f32a6403SWarner Losh	to push back after a failed match etc.
117f32a6403SWarner Losh	Thanks to Miguel Pineiro Jr.
118b2376a5fSWarner Losh
119f32a6403SWarner LoshNov 15, 2023:
120f32a6403SWarner Losh	Man page edit, regression test fixes. Thanks to Arnold Robbins
121f32a6403SWarner Losh	Consolidation of sub and gsub into dosub, removing duplicate
122f32a6403SWarner Losh	code. Thanks to Miguel Pineiro Jr.
123f32a6403SWarner Losh	gcc replaced with cc everywhere.
124b2376a5fSWarner Losh
125f32a6403SWarner LoshOct 30, 2023:
126f32a6403SWarner Losh	Multiple fixes and a minor code cleanup.
127f32a6403SWarner Losh	Disabled utf-8 for non-multibyte locales, such as C or POSIX.
128f32a6403SWarner Losh	Fixed a bad char * cast that causes incorrect results on big-endian
129f32a6403SWarner Losh	systems. Also fixed an out-of-bounds read for empty CCL.
130f32a6403SWarner Losh	Fixed a buffer overflow in substr with utf-8 strings.
131f32a6403SWarner Losh	Many thanks to Todd C Miller.
132b2376a5fSWarner Losh
133f32a6403SWarner LoshSep 24, 2023:
134f32a6403SWarner Losh	fnematch and getrune have been overhauled to solve issues around
135f32a6403SWarner Losh	unicode FS and RS. Also fixed gsub null match issue with unicode.
136f32a6403SWarner Losh	Big thanks to Arnold Robbins.
137b2376a5fSWarner Losh
138f32a6403SWarner LoshSep 12, 2023:
139f32a6403SWarner Losh	Fixed a length error in u8_byte2char that set RSTART to
140f32a6403SWarner Losh	incorrect (cannot happen) value for EOL match(str, /$/).
141b2376a5fSWarner Losh
142b2376a5fSWarner Losh
143f32a6403SWarner Losh-----------------------------------------------------------------
144b2376a5fSWarner Losh
145f32a6403SWarner Losh[This entry is a summary, not a precise list of changes.]
146b2376a5fSWarner Losh
147f32a6403SWarner Losh	Added --csv option to enable processing of comma-separated
148f32a6403SWarner Losh	values inputs.  When --csv is enabled, fields are separated
149f32a6403SWarner Losh	by commas, fields may be quoted with " double quotes, fields
150f32a6403SWarner Losh	may contain embedded newlines.
151b2376a5fSWarner Losh
152f32a6403SWarner Losh	If no explicit separator argument is provided, split() uses
153f32a6403SWarner Losh	the setting of --csv to determine how fields are split.
154b2376a5fSWarner Losh
155f32a6403SWarner Losh	Strings may now contain UTF-8 code points (not necessarily
156f32a6403SWarner Losh	characters).  Functions that operate on characters, like
157f32a6403SWarner Losh	length, substr, index, match, etc., use UTF-8, so the length
158f32a6403SWarner Losh	of a string of 3 emojis is 3, not 12 as it would be if bytes
159f32a6403SWarner Losh	were counted.
160b2376a5fSWarner Losh
161f32a6403SWarner Losh	Regular expressions are processed as UTF-8.
162b2376a5fSWarner Losh
163f32a6403SWarner Losh	Unicode literals can be written as \u followed by one
164f32a6403SWarner Losh	to eight hexadecimal digits.  These may appear in strings and
165f32a6403SWarner Losh	regular expressions.
166