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