xref: /freebsd/contrib/one-true-awk/FIXES (revision b45a181a74c816cfc553e8210954916887fb94dc)
1/****************************************************************
2Copyright (C) Lucent Technologies 1997
3All Rights Reserved
4
5Permission to use, copy, modify, and distribute this software and
6its documentation for any purpose and without fee is hereby
7granted, provided that the above copyright notice appear in all
8copies and that both that the copyright notice and this
9permission notice and warranty disclaimer appear in supporting
10documentation, and that the name Lucent Technologies or any of
11its entities not be used in advertising or publicity pertaining
12to distribution of the software without specific, written prior
13permission.
14
15LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
17IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
18SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
22THIS SOFTWARE.
23****************************************************************/
24
25This file lists all bug fixes, changes, etc., made since the
26second edition of the AWK book was published in September 2023.
27
28Aug 04, 2025
29	Fix incorrect divisor in rand() - it was returning
30	even random numbers only. Thanks to Ozan Yigit.
31
32	Fix a syntax issue with /= that caused constants to
33	turn into variables [eg. 42 /= 7]. Thanks to Arnold
34	Robbins.
35
36Jan 14, 2025
37	Fix incorrect error line number issues. unput has
38	no business managing lineno. Thanks to Ozan Yigit.
39
40Jan 05, 2025
41	Fix hex detection in is_valid_number.
42	Fix indirect field specification with non-numeric string
43	eg. $("foo") in indirect. This is not illegal.
44	Thanks to Arnold Robbins.
45
46Jan 01, 2025
47	Fixed openfile to not try to read from a directory.
48	Thanks to Arnold Robbins.
49
50Jul 28, 2024
51	Fixed readcsvrec resize segfault when reading csv records longer
52	than 8k. Thanks to Ozan Yigit.
53	mktime() added to bsd-features branch. Thanks to Todd Miller.
54
55Jun 23, 2024
56	Fix signal for system-status test. Thanks to Tim van der Molen.
57	Rewrite if-else chain as switch. Thanks to Andrew Sukach.
58
59May 27, 2024
60	Spelling fixes and removal of unneeded prototypes and extern.
61	Thanks to Jonathan Gray.
62
63May 4, 2024
64	Fixed a use-after-free bug with ARGV for "delete ARGV".
65	Also ENVtab is no longer global. Thanks to Benjamin Sturz
66	for spotting the ARGV issue and	Todd Miller for the fix.
67
68May 3, 2024:
69	Remove warnings when compiling with g++. Thanks to Arnold Robbins.
70
71Apr 22, 2024:
72	Fixed regex engine gototab reallocation issue that was
73	Introduced during the Nov 24 rewrite. Thanks to Arnold Robbins.
74	Fixed a scan bug in split in the case the separator is a single
75	character. Thanks to Oguz Ismail for spotting the issue.
76
77Mar 10, 2024:
78	Fixed use-after-free bug in fnematch due to adjbuf invalidating
79	the pointers to buf. Thanks to github user caffe3 for spotting
80	the issue and providing a fix, and to Miguel Pineiro Jr.
81	for the alternative fix.
82	MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max.
83	thanks to Miguel Pineiro Jr.
84
85Jan 22, 2024:
86	Restore the ability to compile with g++. Thanks to
87	Arnold Robbins.
88
89Dec 24, 2023:
90	Matchop dereference after free problem fix when the first
91	argument is a function call. Thanks to Oguz Ismail Uysal.
92	Fix inconsistent handling of --csv and FS set in the
93	command line. Thanks to Wilbert van der Poel.
94	Casting changes to int for is* functions.
95
96Nov 27, 2023:
97	Fix exit status of system on MacOS. Update to REGRESS.
98	Thanks to Arnold Robbins.
99	Fix inconsistent handling of -F and --csv, and loss of csv
100	mode when FS is set.
101
102Nov 24, 2023:
103        Fix issue #199: gototab improvements to dynamically resize the
104        table, qsort and bsearch to improve the lookup speed as the
105        table gets larger for multibyte input. Thanks to Arnold Robbins.
106
107Nov 23, 2023:
108	Fix Issue #169, related to escape sequences in strings.
109	Thanks to Github user rajeevvp.
110	Fix Issue #147, reported by Github user drawkula, and fixed
111	by Miguel Pineiro Jr.
112
113Nov 20, 2023:
114	Rewrite of fnematch to fix a number of issues, including
115	extraneous output, out-of-bounds access, number of bytes
116	to push back after a failed match etc.
117	Thanks to Miguel Pineiro Jr.
118
119Nov 15, 2023:
120	Man page edit, regression test fixes. Thanks to Arnold Robbins
121	Consolidation of sub and gsub into dosub, removing duplicate
122	code. Thanks to Miguel Pineiro Jr.
123	gcc replaced with cc everywhere.
124
125Oct 30, 2023:
126	Multiple fixes and a minor code cleanup.
127	Disabled utf-8 for non-multibyte locales, such as C or POSIX.
128	Fixed a bad char * cast that causes incorrect results on big-endian
129	systems. Also fixed an out-of-bounds read for empty CCL.
130	Fixed a buffer overflow in substr with utf-8 strings.
131	Many thanks to Todd C Miller.
132
133Sep 24, 2023:
134	fnematch and getrune have been overhauled to solve issues around
135	unicode FS and RS. Also fixed gsub null match issue with unicode.
136	Big thanks to Arnold Robbins.
137
138Sep 12, 2023:
139	Fixed a length error in u8_byte2char that set RSTART to
140	incorrect (cannot happen) value for EOL match(str, /$/).
141
142
143-----------------------------------------------------------------
144
145[This entry is a summary, not a precise list of changes.]
146
147	Added --csv option to enable processing of comma-separated
148	values inputs.  When --csv is enabled, fields are separated
149	by commas, fields may be quoted with " double quotes, fields
150	may contain embedded newlines.
151
152	If no explicit separator argument is provided, split() uses
153	the setting of --csv to determine how fields are split.
154
155	Strings may now contain UTF-8 code points (not necessarily
156	characters).  Functions that operate on characters, like
157	length, substr, index, match, etc., use UTF-8, so the length
158	of a string of 3 emojis is 3, not 12 as it would be if bytes
159	were counted.
160
161	Regular expressions are processed as UTF-8.
162
163	Unicode literals can be written as \u followed by one
164	to eight hexadecimal digits.  These may appear in strings and
165	regular expressions.
166