1 2020-07-30 Arnold D. Robbins <arnold@skeeve.com>
3 By fiat, we use bison for $(YACC). Trying to accommodate
4 different versions didn't work.
6 * makefile: Significant cleanup. Replace all ytab* references
7 with awkgram.tab.* and simplify definition of YACC.
8 * .gitignore: Remove ytab* references.
9 * b.c, lex.c, maketab.c, parse.c, run.c: Replace include of ytab.h
11 * lib.c, main.c, tran.c: Remove include of ytab.h, wasn't needed.
13 2020-01-20 Arnold D. Robbins <arnold@skeeve.com>
15 * run.c (openfile): Set the close-on-exec flag for file
16 and pipe redirections that aren't stdin/stdout/stderr.
18 2020-01-06 Arnold D. Robbins <arnold@skeeve.com>
21 * b.c (replace_repeat): Turn init_q back into an int.
22 * lex.c (string): Use \a instead of \007.
23 * tran.c (catstr): Use snprintf instead of sprintf.
25 2020-01-01 Arnold D. Robbins <arnold@skeeve.com>
27 * tran.c (syminit, arginit, envinit): Free sval member before
28 setting it. Thanks to valgrind.
29 * b.c: Small formatting cleanups in several routines.
31 2019-12-27 Arnold D. Robbins <arnold@skeeve.com>
33 * b.c (replace_repeat): Fix a bug whereby a{0,3} could match
34 four a's. Thanks to Anonymous AWK fan <awkfan77@mailfence.com>
35 for the report. Also, minor code formatting cleanups.
36 * testdir/T.int-expr: New file.
38 2019-12-11 Arnold D. Robbins <arnold@skeeve.com>
40 * README: Renamed to ...
41 * README.md: ... this. Cleaned up some as well,
42 including moving to Markdown.
44 2019-11-08 Arnold D. Robbins <arnold@skeeve.com>
46 * test/T.chem: Use $oldawk instead of hardwiring 'awk'.
47 * test/T.lilly: Remove gawk warnings from output, improves
50 2019-10-17 Arnold D. Robbins <arnold@skeeve.com>
52 Pull in systime() and strftime() from the NetBSD awk.
54 * awk.1: Document the functions.
55 * run.c (bltin): Implement the functions.
56 * awk.h: Add defines for systime and strftime.
57 * lex.c: Add support for systime and strftime.
59 2019-10-07 Arnold D. Robbins <arnold@skeeve.com>
61 Integrate features from different *BSD versions of awk.
62 Gensub support from NetBSD. Bitwise functions from OpenBSD.
64 * awk.h: Add defines for and, or, xor, compl, lshift and rshift.
65 * awkgram.y: Add support for gensub.
67 * lex.c: Add support for gensub and bitwise functions.
68 * parse.c (node5, op5): New functions.
69 * proto.h (node5, op5): New declarations.
70 * run.c (bltin): Implement the bitwise functions.
71 (gensub): New function.
72 * awk.1: Document additional functions.
74 2019-10-07 Arnold D. Robbins <arnold@skeeve.com>
76 * b.c (fnematch): Change type of pbuf from unsigned char to char.
77 * proto.h (fnematch): Ditto.
79 2019-10-06 Arnold D. Robbins <arnold@skeeve.com>
81 * lib.c (readrec): Allow RS a regular expression. Imported
82 the code from the NetBSD awk.
83 * b.c (fnematch): New function for implementing the feature.
85 * main.c (version): Updated.
87 2019-06-24 Arnold D. Robbins <arnold@skeeve.com>
89 * makefile: Revise to take into account there is no more awktest.tar,
90 add targets 'check' and 'test', and also 'testclean' to clean up
91 after test run. Have 'clean' and 'cleaner' depend upon 'testclean'.
93 2019-06-23 Arnold D. Robbins <arnold@skeeve.com>
95 * testdir: Extracted from awktest.tar and added to Git.
96 * awktest.tar: Removed.
98 2019-06-06 Arnold D. Robbins <arnold@skeeve.com>
100 * awk.1: Fix a typo, minor edits.
102 2019-06-05 Arnold D. Robbins <arnold@skeeve.com>
104 * b.c (relex): Count parentheses and treat umatched right paren
105 as a literal character.
106 * awktest.tar (testdir/T.re): Added a test case.
107 * main.c (version): Updated.
109 2019-05-29 Arnold D. Robbins <arnold@skeeve.com>
111 * lib.c (isclvar): Remove check for additional '=' after
112 first one. No longer needed.
114 2019-01-26 Arnold D. Robbins <arnold@skeeve.com>
116 * main.c (version): Updated.
118 2019-01-25 Arnold D. Robbins <arnold@skeeve.com>
120 * run.c (awkgetline): Check for numeric value in all getline
121 variants. See the numeric-getline.* files in bugs-fixed directory.
123 2018-08-29 Arnold D. Robbins <arnold@skeeve.com>
125 * REGRESS: Check for existence of a.out. If not there, run
126 make. Enable core dumps for T.arnold system status test
129 2018-08-22 Arnold D. Robbins <arnold@skeeve.com>
131 * awktest.tar (testdir/T.expr): Fix test for unary plus.
133 2018-08-22 Arnold D. Robbins <arnold@skeeve.com>
135 * REGRESS: Extract tests if necessary, set PATH to include '.'.
136 * regdir/beebe.tar (Makefile): Fix longwrds test to prefix
138 * awktest.tar: Updated from fixed test suite, directory
139 it extracts is now called 'testdir' to match what's in top-level
141 * regdir: Removed, as Brian wants to keep the test suite in
144 2018-08-22 Arnold D. Robbins <arnold@skeeve.com>
146 * FIXES, lib.c, run.c, makefile, main.c: Merge from Brian's tree.
147 * REGRESS: New file, from Brian.
148 * awktest.tar: Restored from Brian's tree.
150 2018-08-22 Arnold D. Robbins <arnold@skeeve.com>
152 * awkgram.y (UPLUS): New token. In the grammar, call op1()
154 * maketab.c (proc): Add entry for UPLUS.
155 * run.c (arith): Handle UPLUS.
156 * main.c (version): Updated.
157 * bugs-fixed/unary-plus.awk, bugs-fixed/unary-plus.bad,
158 bugs-fixed/unary-plus.ok: New files.
160 2018-08-10 Arnold D. Robbins <arnold@skeeve.com>
163 * awk.1: Improve use of macros, add some additional explanation
164 in a few places, alphabetize list of variables.
166 2018-08-08 Arnold D. Robbins <arnold@skeeve.com>
168 * awk.h (Cell): Add new field `fmt' to track xFMT value used
169 for a string conversion.
170 [CONVC, CONVO]: New flag macros.
171 * bugs-fixed/README: Updated.
172 * bugs-fixed/string-conv.awk, bugs-fixed/string-conv.bad,
173 bugs-fixed/string-conv.ok: New files.
174 * main.c (version): Updated.
175 * proto.h (flags2str): Add declaration.
176 * tran.c (setfval): Clear CONVC and CONVO flags and set vp->fmt
178 (setsval): Ditto. Add large comment and new code to manage
179 correct conversion of number to string based on various flags
180 and the value of vp->fmt. The idea is to not convert again
181 if xFMT is the same as before and we're doing the same conversion.
182 Otherwise, clear the old flags, set the new, and reconvert.
183 (flags2str): New function. For debug prints and for use from a debugger.
185 2018-08-05 Arnold D. Robbins <arnold@skeeve.com>
187 Fix filename conflicts in regdir where the only difference was
188 in letter case. This caused problems on Windows systems.
190 * regdir/Compare.T1: Renamed from regdir/Compare.T.
191 * regdir/t.delete0: Renamed from regdir/t.delete.
192 * regdir/t.getline1: Renamed from regdir/t.getline.
193 * regdir/t.redir1: Renamed from regdir/t.redir.
194 * regdir/t.split1: Renamed from regdir/t.split.
195 * regdir/t.sub0: Renamed from regdir/t.sub.
196 * regdir/REGRESS: Adjusted.
198 2018-08-04 Arnold D. Robbins <arnold@skeeve.com>
200 With scalpel, tweasers, magnifying glass and bated breath,
201 borrow code from the NetBSD version of nawk to fix the years-old
202 bug whereby decrementing the value of NF did not change the
205 * lib.c (fldbld): Set donerec to 1 when done.
206 (setlastfld): New function.
207 * proto.h (setlastfld): Add declaration.
208 * run.c (copycell): Make code smarter about flags (from NetBSD code).
209 * tran.c (setfree): New function.
210 * tran.c (setfval): Normalize negative zero to positive zero.
211 If setting NF, clear donerec and call setlastfld().
212 (setsval): Remove call to save_old_OFS(). If setting OFS, call
213 recbld(). If setting NF, clear donerec and call setlastfld().
215 As part of the process, revert OFS-related changes of 2018-05-22:
217 * awk.h (saveOFS, saveOFSlen, save_old_OFS): Remove declarations.
218 * lib.c (recbld): Use *OFS instead of saveOFS.
219 * run.c (saveOFS, saveOFSlen, save_old_OFS): Remove.
220 * tran.c (syminit): Remove initialization of saveOFS and saveOFSlen.
222 General stuff that goes along with all this:
224 * bugs-fixed/README: Updated.
225 * bugs-fixed/decr-NF.awk, bugs-fixed/decr-NF.bad,
226 bugs-fixed/decr-NF.ok: New files.
227 * main.c (version): Updated.
228 * regdir/README.TESTS: Fix awk book title.
229 * regdir/T.misc: Revise test to match fixed code.
230 * run.c (format): Increase size of buffer used for %a test. (Unrelated
231 to NF or OFS, but fixes a compiler complaint.)
233 2018-06-07 Arnold D. Robbins <arnold@skeeve.com>
235 * regdir/beebe.tar: Fix longwrds.ok so that the test will pass.
236 The file was incorrectly sorted.
238 2018-06-06 Arnold D. Robbins <arnold@skeeve.com>
240 * regdir/T.lilly: Fix the bug again in the second instance
241 of the code. Thanks to BWK for pointing this out.
243 2018-05-31 Arnold D. Robbins <arnold@skeeve.com>
245 * regdir/T.lilly: Fix a syntax error and ordering bug
246 in creating the 'foo' file.
248 2018-05-23 Arnold D. Robbins <arnold@skeeve.com>
250 * awk.1: Remove standalone 'awk' at the top of file, it messed up
251 the formatting. Arrange built-in variable list in alphabetical
254 2018-05-23 Arnold D. Robbins <arnold@skeeve.com>
256 * main.c (version): Add my email address and a date so that
257 users can tell this isn't straight BWK awk.
258 * README.md: Minor updates.
261 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
263 Add POSIX-required formats %a and %A.
265 * run.c (format): Check for %a support in C library. If there,
266 allow %a and %A as valid formats.
268 * bugs-fixed/README: Updated.
269 * bugs-fixed/a-format.awk, bugs-fixed/a-format.bad,
270 bugs-fixed/a-format.ok: New files.
272 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
274 * FIXES: Restored a line from a much earlier version that
275 apparently got lost when the dates were reordered.
278 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
280 * README.md: New file.
282 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
284 * regdir/echo.c, regdir/time.c: Minor fixes to compile without
285 warning on current GCC / Linux.
287 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
291 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
293 * makefile (gitadd, gitpush): Remove these targets. They
294 should not be automated and were incorrect for things that
295 would be done regularly.
297 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
299 Fix nawk so that [[:blank:]] only matches space and tab instead
300 of any whitespace character, originally made May 10, 2018.
301 See bugs-fixed/space.awk.
303 This appears to have been a thinko on Brian's part.
305 * b.c (charclasses): Use xisblank() function for [[:blank:]].
306 * bugs-fixed/README: Updated.
307 * bugs-fixed/space.awk, bugs-fixed/space.bad,
308 bugs-fixed/space.ok: New files.
310 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
312 * .gitignore: New file.
314 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
316 Fix nawk to provide reasonable exit status for system(),
317 a la gawk, originally made March 12, 2016. See
318 bugs-fixed/system-status.awk.
320 * run.c (bltin): For FSYSTEM, use the macros defined for wait(2)
321 to produce a reasonable exit value, instead of doing a floating-point
323 * awk.1: Document the return status values.
324 * bugs-fixed/README: Updated.
325 * bugs-fixed/system-status.awk, bugs-fixed/system-status.bad,
326 bugs-fixed/system-status.ok: New files.
328 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
330 Bug fix with respect to rebuilding a record, originally
331 made August 19, 2014. See bugs-fixed/ofs-rebuild.awk.
333 * awk.h (saveOFS, saveOFSlen): Declare new variables.
334 * lib.c (recbld): Use them when rebuilding the record.
335 * run.c (saveOFS, saveOFSlen): Define new variables.
336 (save_old_OFS): New function to save OFS aside.
337 * tran.c (syminit): Initialize saveOFS and saveOFSlen.
338 (setsval): If setting a field, call save_old_OFS().
339 * bugs-fixed/README, bugs-fixed/ofs-rebuild.awk,
340 bugs-fixed/ofs-rebuild.bad, bugs-fixed/ofs-rebuild.ok: New files.
342 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
344 * makefile (YACC): Use bison.
346 2018-05-22 Arnold D. Robbins <arnold@skeeve.com>
348 * ChangeLog: Created.
349 * regdir: Created. Based on contents of awktest.a.
350 * .gitattributes: Created, to preserve CR LF in regdir/t.crlf.
351 * awktest.a: Removed.
352 * regdir/T.gawk, regdir/T.latin1: Updated from awktest.tar.
353 * awktest.tar: Removed.