xref: /netbsd-src/external/historical/nawk/dist/ChangeLog (revision d16b7486a53dcb8072b60ec6fcb4373a2d0c27b7)
12020-01-20         Arnold D. Robbins     <arnold@skeeve.com>
2
3	* run.c (openfile): Set the close-on-exec flag for file
4	and pipe redirections that aren't stdin/stdout/stderr.
5
62020-01-06         Arnold D. Robbins     <arnold@skeeve.com>
7
8	Minor fixes.
9	* b.c (replace_repeat): Turn init_q back into an int.
10	* lex.c (string): Use \a instead of \007.
11	* tran.c (catstr): Use snprintf instead of sprintf.
12
132020-01-01         Arnold D. Robbins     <arnold@skeeve.com>
14
15	* tran.c (syminit, arginit, envinit): Free sval member before
16	setting it. Thanks to valgrind.
17	* b.c: Small formatting cleanups in several routines.
18
192019-12-27         Arnold D. Robbins     <arnold@skeeve.com>
20
21	* b.c (replace_repeat): Fix a bug whereby a{0,3} could match
22	four a's.  Thanks to Anonymous AWK fan <awkfan77@mailfence.com>
23	for the report. Also, minor code formatting cleanups.
24	* testdir/T.int-expr: New file.
25
262019-12-11         Arnold D. Robbins     <arnold@skeeve.com>
27
28	* README: Renamed to ...
29	* README.md: ... this. Cleaned up some as well,
30	including moving to Markdown.
31
322019-11-08         Arnold D. Robbins     <arnold@skeeve.com>
33
34	* test/T.chem: Use $oldawk instead of hardwiring 'awk'.
35	* test/T.lilly: Remove gawk warnings from output, improves
36	portability.
37
382019-10-17         Arnold D. Robbins     <arnold@skeeve.com>
39
40	Pull in systime() and strftime() from the NetBSD awk.
41
42	* awk.1: Document the functions.
43	* run.c (bltin): Implement the functions.
44	* awk.h: Add defines for systime and strftime.
45	* lex.c: Add support for systime and strftime.
46
472019-10-07         Arnold D. Robbins     <arnold@skeeve.com>
48
49	Integrate features from different *BSD versions of awk.
50	Gensub support from NetBSD. Bitwise functions from OpenBSD.
51
52	* awk.h: Add defines for and, or, xor, compl, lshift and rshift.
53	* awkgram.y: Add support for gensub.
54	* maketab.c: Ditto.
55	* lex.c: Add support for gensub and bitwise functions.
56	* parse.c (node5, op5): New functions.
57	* proto.h (node5, op5): New declarations.
58	* run.c (bltin): Implement the bitwise functions.
59	(gensub): New function.
60	* awk.1: Document additional functions.
61
622019-10-07         Arnold D. Robbins     <arnold@skeeve.com>
63
64	* b.c (fnematch): Change type of pbuf from unsigned char to char.
65	* proto.h (fnematch): Ditto.
66
672019-10-06         Arnold D. Robbins     <arnold@skeeve.com>
68
69	* lib.c (readrec): Allow RS a regular expression. Imported
70	the code from the NetBSD awk.
71	* b.c (fnematch): New function for implementing the feature.
72	* awk.1: Updated.
73	* main.c (version): Updated.
74
752019-06-24         Arnold D. Robbins     <arnold@skeeve.com>
76
77	* makefile: Revise to take into account there is no more awktest.tar,
78	add targets 'check' and 'test', and also 'testclean' to clean up
79	after test run.  Have 'clean' and 'cleaner' depend upon 'testclean'.
80
812019-06-23         Arnold D. Robbins     <arnold@skeeve.com>
82
83	* testdir: Extracted from awktest.tar and added to Git.
84	* awktest.tar: Removed.
85
862019-06-06         Arnold D. Robbins     <arnold@skeeve.com>
87
88	* awk.1: Fix a typo, minor edits.
89
902019-06-05         Arnold D. Robbins     <arnold@skeeve.com>
91
92	* b.c (relex): Count parentheses and treat umatched right paren
93	as a literal character.
94	* awktest.tar (testdir/T.re): Added a test case.
95	* main.c (version): Updated.
96
972019-05-29         Arnold D. Robbins     <arnold@skeeve.com>
98
99	* lib.c (isclvar): Remove check for additional '=' after
100	first one. No longer needed.
101
1022019-01-26         Arnold D. Robbins     <arnold@skeeve.com>
103
104	* main.c (version): Updated.
105
1062019-01-25         Arnold D. Robbins     <arnold@skeeve.com>
107
108	* run.c (awkgetline): Check for numeric value in all getline
109	variants. See the numeric-getline.* files in bugs-fixed directory.
110
1112018-08-29         Arnold D. Robbins     <arnold@skeeve.com>
112
113	* REGRESS: Check for existence of a.out. If not there, run
114	make.  Enable core dumps for T.arnold system status test
115	to work on MacOS X.
116
1172018-08-22         Arnold D. Robbins     <arnold@skeeve.com>
118
119	* awktest.tar (testdir/T.expr): Fix test for unary plus.
120
1212018-08-22         Arnold D. Robbins     <arnold@skeeve.com>
122
123	* REGRESS: Extract tests if necessary, set PATH to include '.'.
124	* regdir/beebe.tar (Makefile): Fix longwrds test to prefix
125	sort with LC_ALL=C.
126	* awktest.tar: Updated from fixed test suite, directory
127	it extracts is now called 'testdir' to match what's in top-level
128	REGRESS script.
129	* regdir: Removed, as Brian wants to keep the test suite in
130	the tar file.
131
1322018-08-22         Arnold D. Robbins     <arnold@skeeve.com>
133
134	* FIXES, lib.c, run.c, makefile, main.c: Merge from Brian's tree.
135	* REGRESS: New file, from Brian.
136	* awktest.tar: Restored from Brian's tree.
137
1382018-08-22         Arnold D. Robbins     <arnold@skeeve.com>
139
140	* awkgram.y (UPLUS): New token. In the grammar, call op1()
141	with it.
142	* maketab.c (proc): Add entry for UPLUS.
143	* run.c (arith): Handle UPLUS.
144	* main.c (version): Updated.
145	* bugs-fixed/unary-plus.awk, bugs-fixed/unary-plus.bad,
146	bugs-fixed/unary-plus.ok: New files.
147
1482018-08-10         Arnold D. Robbins     <arnold@skeeve.com>
149
150	* TODO: Updated.
151	* awk.1: Improve use of macros, add some additional explanation
152	in a few places, alphabetize list of variables.
153
1542018-08-08         Arnold D. Robbins     <arnold@skeeve.com>
155
156	* awk.h (Cell): Add new field `fmt' to track xFMT value used
157	for a string conversion.
158	[CONVC, CONVO]: New flag macros.
159	* bugs-fixed/README: Updated.
160	* bugs-fixed/string-conv.awk, bugs-fixed/string-conv.bad,
161	bugs-fixed/string-conv.ok: New files.
162	* main.c (version): Updated.
163	* proto.h (flags2str): Add declaration.
164	* tran.c (setfval): Clear CONVC and CONVO flags and set vp->fmt
165	to NULL.
166	(setsval): Ditto. Add large comment and new code to manage
167	correct conversion of number to string based on various flags
168	and the value of vp->fmt. The idea is to not convert again
169	if xFMT is the same as before and we're doing the same conversion.
170	Otherwise, clear the old flags, set the new, and reconvert.
171	(flags2str): New function. For debug prints and for use from a debugger.
172
1732018-08-05         Arnold D. Robbins     <arnold@skeeve.com>
174
175	Fix filename conflicts in regdir where the only difference was
176	in letter case. This caused problems on Windows systems.
177
178	* regdir/Compare.T1: Renamed from regdir/Compare.T.
179	* regdir/t.delete0: Renamed from regdir/t.delete.
180	* regdir/t.getline1: Renamed from regdir/t.getline.
181	* regdir/t.redir1: Renamed from regdir/t.redir.
182	* regdir/t.split1: Renamed from regdir/t.split.
183	* regdir/t.sub0: Renamed from regdir/t.sub.
184	* regdir/REGRESS: Adjusted.
185
1862018-08-04         Arnold D. Robbins     <arnold@skeeve.com>
187
188	With scalpel, tweasers, magnifying glass and bated breath,
189	borrow code from the NetBSD version of nawk to fix the years-old
190	bug whereby decrementing the value of NF did not change the
191	record.
192
193	* lib.c (fldbld): Set donerec to 1 when done.
194	(setlastfld): New function.
195	* proto.h (setlastfld): Add declaration.
196	* run.c (copycell): Make code smarter about flags (from NetBSD code).
197	* tran.c (setfree): New function.
198	* tran.c (setfval): Normalize negative zero to positive zero.
199	If setting NF, clear donerec and call setlastfld().
200	(setsval): Remove call to save_old_OFS().  If setting OFS, call
201	recbld(). If setting NF, clear donerec and call setlastfld().
202
203	As part of the process, revert OFS-related changes of 2018-05-22:
204
205	* awk.h (saveOFS, saveOFSlen, save_old_OFS): Remove declarations.
206	* lib.c (recbld): Use *OFS instead of saveOFS.
207	* run.c (saveOFS, saveOFSlen, save_old_OFS): Remove.
208	* tran.c (syminit): Remove initialization of saveOFS and saveOFSlen.
209
210	General stuff that goes along with all this:
211
212	* bugs-fixed/README: Updated.
213	* bugs-fixed/decr-NF.awk, bugs-fixed/decr-NF.bad,
214	bugs-fixed/decr-NF.ok: New files.
215	* main.c (version): Updated.
216	* regdir/README.TESTS: Fix awk book title.
217	* regdir/T.misc: Revise test to match fixed code.
218	* run.c (format): Increase size of buffer used for %a test. (Unrelated
219	to NF or OFS, but fixes a compiler complaint.)
220
2212018-06-07         Arnold D. Robbins     <arnold@skeeve.com>
222
223	* regdir/beebe.tar: Fix longwrds.ok so that the test will pass.
224	The file was incorrectly sorted.
225
2262018-06-06         Arnold D. Robbins     <arnold@skeeve.com>
227
228	* regdir/T.lilly: Fix the bug again in the second instance
229	of the code. Thanks to BWK for pointing this out.
230
2312018-05-31         Arnold D. Robbins     <arnold@skeeve.com>
232
233	* regdir/T.lilly: Fix a syntax error and ordering bug
234	in creating the 'foo' file.
235
2362018-05-23         Arnold D. Robbins     <arnold@skeeve.com>
237
238	* awk.1: Remove standalone 'awk' at the top of file, it messed up
239	the formatting. Arrange built-in variable list in alphabetical
240	order.
241
2422018-05-23         Arnold D. Robbins     <arnold@skeeve.com>
243
244	* main.c (version): Add my email address and a date so that
245	users can tell this isn't straight BWK awk.
246	* README.md: Minor updates.
247	* TODO: Updated.
248
2492018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
250
251	Add POSIX-required formats %a and %A.
252
253	* run.c (format): Check for %a support in C library. If there,
254	allow %a and %A as valid formats.
255	* TODO: Updated.
256	* bugs-fixed/README: Updated.
257	* bugs-fixed/a-format.awk, bugs-fixed/a-format.bad,
258	bugs-fixed/a-format.ok: New files.
259
2602018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
261
262	* FIXES: Restored a line from a much earlier version that
263	apparently got lost when the dates were reordered.
264	* TODO: Updated.
265
2662018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
267
268	* README.md: New file.
269
2702018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
271
272	* regdir/echo.c, regdir/time.c: Minor fixes to compile without
273	warning on current GCC / Linux.
274
2752018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
276
277	* TODO: New file.
278
2792018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
280
281	* makefile (gitadd, gitpush): Remove these targets. They
282	should not be automated and were incorrect for things that
283	would be done regularly.
284
2852018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
286
287	Fix nawk so that [[:blank:]] only matches space and tab instead
288	of any whitespace character, originally made May 10, 2018.
289	See bugs-fixed/space.awk.
290
291	This appears to have been a thinko on Brian's part.
292
293	* b.c (charclasses): Use xisblank() function for [[:blank:]].
294	* bugs-fixed/README: Updated.
295	* bugs-fixed/space.awk, bugs-fixed/space.bad,
296	bugs-fixed/space.ok: New files.
297
2982018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
299
300	* .gitignore: New file.
301
3022018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
303
304	Fix nawk to provide reasonable exit status for system(),
305	a la gawk, originally made March 12, 2016. See
306	bugs-fixed/system-status.awk.
307
308	* run.c (bltin): For FSYSTEM, use the macros defined for wait(2)
309	to produce a reasonable exit value, instead of doing a floating-point
310	division by 256.
311	* awk.1: Document the return status values.
312	* bugs-fixed/README: Updated.
313	* bugs-fixed/system-status.awk, bugs-fixed/system-status.bad,
314	bugs-fixed/system-status.ok: New files.
315
3162018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
317
318	Bug fix with respect to rebuilding a record, originally
319	made August 19, 2014. See bugs-fixed/ofs-rebuild.awk.
320
321	* awk.h (saveOFS, saveOFSlen): Declare new variables.
322	* lib.c (recbld): Use them when rebuilding the record.
323	* run.c (saveOFS, saveOFSlen): Define new variables.
324	(save_old_OFS): New function to save OFS aside.
325	* tran.c (syminit): Initialize saveOFS and saveOFSlen.
326	(setsval): If setting a field, call save_old_OFS().
327	* bugs-fixed/README, bugs-fixed/ofs-rebuild.awk,
328	bugs-fixed/ofs-rebuild.bad, bugs-fixed/ofs-rebuild.ok: New files.
329
3302018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
331
332	* makefile (YACC): Use bison.
333
3342018-05-22         Arnold D. Robbins     <arnold@skeeve.com>
335
336	* ChangeLog: Created.
337	* regdir: Created. Based on contents of awktest.a.
338	* .gitattributes: Created, to preserve CR LF in regdir/t.crlf.
339	* awktest.a: Removed.
340	* regdir/T.gawk, regdir/T.latin1: Updated from awktest.tar.
341	* awktest.tar: Removed.
342