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 AWK book 26was sent to the printers in August, 1987. 27 28December 8, 2021: 29 The error handling in closefile and closeall was mangled. Long 30 standing warnings had been made fatal and some fatal errors went 31 undetected. Thanks to Miguel Pineiro Jr. <mpj@pineiro.cc>. 32 33Nov 03, 2021: 34 getline accesses uninitialized data after getrec() 35 returns 0 on EOF and leaves the contents of buf unchanged. 36 Thanks to Volodymyr Gubarkov, and Todd C Miller. 37 38Oct 12, 2021: 39 The fix for #83 changed the code to insert 2 chars, but the 40 call to adjbuf just above it only allows for 1 char. This can 41 cause a heap buffer overflow. 42 43July 27, 2021: 44 As per IEEE Std 1003.1-2008, -F "str" is now consistent with 45 -v FS="str" when str is null. Thanks to Warner Losh. 46 47July 24, 2021: 48 Fix readrec's definition of a record. This fixes an issue 49 with NetBSD's RS regular expression support that can cause 50 an infinite read loop. Thanks to Miguel Pineiro Jr. 51 52 Fix regular expression RS ^-anchoring. RS ^-anchoring needs to 53 know if it is reading the first record of a file. This change 54 restores a missing line that was overlooked when porting NetBSD's 55 RS regex functionality. Thanks to Miguel Pineiro Jr. 56 57 Fix size computation in replace_repeat() for special case 58 REPEAT_WITH_Q. Thanks to Todd C. Miller. 59 60February 15, 2021: 61 Small fix so that awk will compile again with g++. Thanks to 62 Arnold Robbins. 63 64January 06, 2021: 65 Fix a decision bug with trailing stuff in lib.c:is_valid_number 66 after recent changes. Thanks to Ozan Yigit. 67 68December 18, 2020: 69 Fix problems converting inf and NaN values in lib.c:is_valid_number. 70 Enhance number to string conversion to do the right thing for 71 NaN and inf values. Things are now pretty much the same as in 72 gawk. (Found a gawk bug while we're at it.) Added a torture 73 test for these values. Thanks to Arnold Robbins. Allows closing 74 of PR #101. 75 76December 15, 2020: 77 Merge PR #99, which gets the right header for strcasecmp. 78 Thanks to GitHub user michaelforney. 79 80December 8, 2020: 81 Merge PR #98: Disallow hex data. Allow only +nan, -nan, 82 +inf, -inf (case independent) to give NaN and infinity values. 83 Improve things so that string to double conversion is only 84 done once, yielding something of a speedup. This obviate 85 PR #95. Thanks to Arnold Robbins. 86 87December 3, 2020: 88 Fix to argument parsing to avoid printing spurious newlines. 89 Thanks to Todd Miller. Merges PR #97. 90 91October 13, 2020: 92 Add casts before all the calls to malloc/calloc/realloc in order 93 to get it to compile with g++. Thanks to Arnold Robbins. 94 95August 16, 2020: 96 Additional fixes for DJGPP. Thanks to Eli Zaretskii for 97 the testing. 98 99August 7, 2020: 100 Merge PR #93, which adds casts to (void*) for debug prints 101 using the %p format specifier. Thanks to GitHub user YongHaoWu 102 ("Chris") for the fixes. 103 104August 4, 2020: 105 In run.c, use non-restartable multibyte routines to attain 106 portability to DJGPP. Should fix Issue 92. Thanks to Albert Wik 107 for the report and to Todd Miller for the suggested fix. 108 109July 30, 2020: 110 Merge PRs 88-91 which fix small bugs. Thanks to Todd Miller and 111 Tim van der Molen for the fixes. 112 113 In order to make life easier, we move exclusively to bison 114 as the parser generator. 115 116July 2, 2020: 117 Merge PRs 85 and 86 which fix regressions. Thanks to 118 Tim van der Molen for the fixes. 119 120June 25, 2020: 121 Merge PRs 82 and 84. The latter fixes issue #83. Thanks to 122 Todd Miller and awkfan77. 123 124June 12, 2020: 125 Clear errno before calling errcheck to avoid any spurious errors 126 left over from previous calls that may have set it. Thanks to 127 Todd Miller for the fix, from PR #80. 128 129 Fix Issue #78 by allowing \r to follow floating point numbers in 130 lib.c:is_number. Thanks to GitHub user ajcarr for the report 131 and to Arnold Robbins for the fix. 132 133June 5, 2020: 134 In fldbld(), make sure that inputFS is set before trying to 135 use it. Thanks to Steffen Nurpmeso <steffen@sdaoden.eu> 136 for the report. 137 138May 5, 2020: 139 Fix checks for compilers that can handle noreturn. Thanks to 140 GitHub user enh-google for pointing it out. Closes Issue #79. 141 142April 16, 2020: 143 Handle old compilers that don't support C11 (for noreturn). 144 Thanks to Arnold Robbins. 145 146April 5, 2020: 147 Use <stdnoreturn.h> and noreturn instead of GCC attributes. 148 Thanks to GitHub user awkfan77. Closes PR #77. 149 150February 28, 2020: 151 More cleanups from Christos Zoulas: notably backslash continuation 152 inside strings removes the newline and a fix for RS = "^a". 153 Fix for address sanitizer-found problem. Thanks to GitHub user 154 enh-google. 155 156February 19, 2020: 157 More small cleanups from Christos Zoulas. 158 159February 18, 2020: 160 Additional cleanups from Christos Zoulas. It's no longer necessary 161 to use the -y flag to bison. 162 163February 6, 2020: 164 Additional small cleanups from Christos Zoulas. awk is now 165 a little more robust about reporting I/O errors upon exit. 166 167January 31, 2020: 168 Merge PR #70, which avoids use of variable length arrays. Thanks 169 to GitHub user michaelforney. Fix issue #60 ({0} in interval 170 expressions doesn't work). Also get all tests working again. 171 Thanks to Arnold Robbins. 172 173January 24, 2020: 174 A number of small cleanups from Christos Zoulas. Add the close 175 on exec flag to files/pipes opened for redirection; courtesy of 176 Arnold Robbins. 177 178January 19, 2020: 179 If POSIXLY_CORRECT is set in the environment, then sub and gsub 180 use POSIX rules for multiple backslashes. This fixes Issue #66, 181 while maintaining backwards compatibility. 182 183January 9, 2020: 184 Input/output errors on closing files are now fatal instead of 185 mere warnings. Thanks to Martijn Dekker <martijn@inlv.org>. 186 187January 5, 2020: 188 Fix a bug in the concatentation of two string constants into 189 one done in the grammar. Fixes GitHub issue #61. Thanks 190 to GitHub user awkfan77 for pointing out the direction for 191 the fix. New test T.concat added to the test suite. 192 Fix a few memory leaks reported by valgrind, as well. 193 194December 27, 2019: 195 Fix a bug whereby a{0,3} could match four a's. Thanks to 196 "Anonymous AWK fan" for the report. 197 198December 11, 2019: 199 Further printf-related fixes for 32 bit systems. 200 Thanks again to Christos Zoulas. 201 202December 8, 2019: 203 Fix the return value of sprintf("%d") on 32 bit systems. 204 Thanks to Jim Lowe for the report and to Christos Zoulas 205 for the fix. 206 207November 10, 2019: 208 Convert a number of Boolean integer variables into 209 actual bools. Convert compile_time variable into an 210 enum and simplify some of the related code. Thanks 211 to Arnold Robbins. 212 213November 8, 2019: 214 Fix from Ori Bernstein to get UTF-8 characters instead of 215 bytes when FS = "". This is currently the only bit of 216 the One True Awk that understands multibyte characters. 217 From Arnold Robbins, apply some cleanups in the test suite. 218 219October 25, 2019: 220 More fixes and cleanups from NetBSD, courtesy of Christos 221 Zoulas. Merges PRs 54 and 55. 222 223October 24, 2019: 224 Import second round of code cleanups from NetBSD. Much thanks 225 to Christos Zoulas (GitHub user zoulasc). Merges PR 53. 226 Add an optimization for string concatenation, also from 227 Christos. 228 229October 17, 2019: 230 Import code cleanups from NetBSD. Much thanks to Christos 231 Zoulas (GitHub user zoulasc). Merges PR 51. 232 233October 6, 2019: 234 Import code from NetBSD awk that implements RS as a regular 235 expression. 236 237September 10, 2019: 238 Fixes for various array / memory overruns found via gcc's 239 -fsanitize=unknown. Thanks to Alexander Richardson (GitHub 240 user arichardson). Merges PRs 47 and 48. 241 242July 28, 2019: 243 Import grammar optimization from NetBSD: Two string constants 244 concatenated together get turned into a single string. 245 246July 26, 2019: 247 Support POSIX-specified C-style escape sequences "\a" (alarm) 248 and "\v" (vertical tab) in command line arguments and regular 249 expressions, further to the support for them in strings added on 250 Apr 9, 1989. These now no longer match as literal "a" and "v" 251 characters (as they don't on other awk implementations). 252 Thanks to Martijn Dekker. 253 254July 17, 2019: 255 Pull in a number of code cleanups and minor fixes from 256 Warner Losh's bsd-ota branch. The only user visible change 257 is the use of random(3) as the random number generator. 258 Thanks to Warner Losh for collecting all these fixes in 259 one easy place to get them from. 260 261July 16, 2019: 262 Fix field splitting to use FS value as of the time a record 263 was read or assigned to. Thanks to GitHub user Cody Mello (melloc) 264 for the fix. (Merged from his branch, via PR #42.) Updated 265 testdir/T.split per said PR as well. 266 267June 24, 2019: 268 Extract awktest.tar into testdir directory. Add some very 269 simple mechanics to the makefile for running the tests and 270 for cleaning up. No changes to awk itself. 271 272June 17, 2019: 273 Disallow deleting SYMTAB and its elements, which creates 274 use-after-free bugs. Thanks to GitHub user Cody Mello (melloc) 275 for the fix. (Merged from PR #43.) 276 277June 5, 2019: 278 Allow unmatched right parenthesis in a regular expression to 279 be treated literally. Fixes Issue #40. Thanks to GitHub user 280 Warner Losh (bsdimp) for the report. Thanks to Arnold Robbins 281 for the fix. 282 283May 29,2019: 284 Fix check for command line arguments to no longer require that 285 first character after '=' not be another '='. Reverts change of 286 August 11, 1989. Thanks to GitHub user Jamie Landeg Jones for 287 pointing out the issue; from Issue #38. 288 289Apr 7, 2019: 290 Update awktest.tar(p.50) to use modern options to sort. Needed 291 for Android development. Thanks to GitHub user mohd-akram (Mohamed 292 Akram). From Issue #33. 293 294Mar 12, 2019: 295 Added very simplistic support for cross-compiling in the 296 makefile. We are NOT going to go in the direction of the 297 autotools, though. Thanks to GitHub user nee-san for 298 the basic change. (Merged from PR #34.) 299 300Mar 5, 2019: 301 Added support for POSIX-standard interval expressions (a.k.a. 302 bounds, a.k.a. repetition expressions) in regular expressions, 303 backported (via NetBSD) from Apple awk-24 (20070501). 304 Thanks to Martijn Dekker <martijn@inlv.org> for the port. 305 (Merged from PR #30.) 306 307Mar 3, 2019: 308 Merge PRs as follows: 309 #12: Avoid undefined behaviour when using ctype(3) functions in 310 relex(). Thanks to GitHub user iamleot. 311 #31: Make getline handle numeric strings, and update FIXES. Thanks 312 to GitHub user arnoldrobbins. 313 #32: maketab: support build systems with read-only source. Thanks 314 to GitHub user enh. 315 316Jan 25, 2019: 317 Make getline handle numeric strings properly in all cases. 318 (Thanks, Arnold.) 319 320Jan 21, 2019: 321 Merged a number of small fixes from GitHub pull requests. 322 Thanks to GitHub users Arnold Robbins (arnoldrobbins), 323 Cody Mello (melloc) and Christoph Junghans (junghans). 324 PR numbers: 13-21, 23, 24, 27. 325 326Oct 25, 2018: 327 Added test in maketab.c to prevent generating a proctab entry 328 for YYSTYPE_IS_DEFINED. It was harmless but some gcc settings 329 generated a warning message. Thanks to Nan Xiao for report. 330 331Aug 27, 2018: 332 Disallow '$' in printf formats; arguments evaluated in order 333 and printed in order. 334 335 Added some casts to silence warnings on debugging printfs. 336 (Thanks, Arnold.) 337 338Aug 23, 2018: 339 A long list of fixes courtesy of Arnold Robbins, 340 to whom profound thanks. 341 342 1. ofs-rebuild: OFS value used to rebuild the record was incorrect. 343 Fixed August 19, 2014. Revised fix August 2018. 344 345 2. system-status: Instead of a floating-point division by 256, use 346 the wait(2) macros to create a reasonable exit status. 347 Fixed March 12, 2016. 348 349 3. space: Use provided xisblank() function instead of ispace() for 350 matching [[:blank:]]. 351 352 4. a-format: Add POSIX standard %a and %A to supported formats. Check 353 at runtime that this format is available. 354 355 5. decr-NF: Decrementing NF did not change $0. This is a decades-old 356 bug. There are interactions with the old and new value of OFS as well. 357 Most of the fix came from the NetBSD awk. 358 359 6. string-conv: String conversions of scalars were sticky. Once a 360 conversion to string happened, even with OFMT, that value was used until 361 a new numeric value was assigned, even if OFMT differed from CONVFMT, 362 and also if CONVFMT changed. 363 364 7. unary-plus: Unary plus on a string constant returned the string. 365 Instead, it should convert the value to numeric and give that value. 366 367 Also added Arnold's tests for these to awktest.tar as T.arnold. 368 369Aug 15, 2018: 370 fixed mangled awktest.tar (thanks, Arnold), posted all 371 current (very minor) fixes to github / onetrueawk 372 373Jun 7, 2018: 374 (yes, a long layoff) 375 Updated some broken tests (beebe.tar, T.lilly) 376 [thanks to Arnold Robbins] 377 378Mar 26, 2015: 379 buffer overflow in error reporting; thanks to tobias ulmer 380 and john-mark gurney for spotting it and the fix. 381 382Feb 4, 2013: 383 cleaned up a handful of tests that didn't seem to actually 384 test for correct behavior: T.latin1, T.gawk. 385 386Jan 5, 2013: 387 added ,NULL initializer to static Cells in run.c; not really 388 needed but cleaner. Thanks to Michael Bombardieri. 389 390Dec 20, 2012: 391 fiddled makefile to get correct yacc and bison flags. pick yacc 392 (linux) or bison (mac) as necessary. 393 394 added __attribute__((__noreturn__)) to a couple of lines in 395 proto.h, to silence someone's enthusiastic checker. 396 397 fixed obscure call by value bug in split(a[1],a) reported on 398 9fans. the management of temporary values is just a mess; i 399 took a shortcut by making an extra string copy. thanks 400 to paul patience and arnold robbins for passing it on and for 401 proposed patches. 402 403 tiny fiddle in setfval to eliminate -0 results in T.expr, which 404 has irritated me for 20+ years. 405 406Aug 10, 2011: 407 another fix to avoid core dump with delete(ARGV); again, many thanks 408 to ruslan ermilov. 409 410Aug 7, 2011: 411 split(s, a, //) now behaves the same as split(s, a, "") 412 413Jun 12, 2011: 414 /pat/, \n /pat/ {...} is now legal, though bad style to use. 415 416 added checks to new -v code that permits -vnospace; thanks to 417 ruslan ermilov for spotting this and providing the patch. 418 419 removed fixed limit on number of open files; thanks to aleksey 420 cheusov and christos zoulos. 421 422 fixed day 1 bug that resurrected deleted elements of ARGV when 423 used as filenames (in lib.c). 424 425 minor type fiddles to make gcc -Wall -pedantic happier (but not 426 totally so); turned on -fno-strict-aliasing in makefile. 427 428May 6, 2011: 429 added #ifdef for isblank. 430 now allows -ffoo as well as -f foo arguments. 431 (thanks, ruslan) 432 433May 1, 2011: 434 after advice from todd miller, kevin lo, ruslan ermilov, 435 and arnold robbins, changed srand() to return the previous 436 seed (which is 1 on the first call of srand). the seed is 437 an Awkfloat internally though converted to unsigned int to 438 pass to the library srand(). thanks, everyone. 439 440 fixed a subtle (and i hope low-probability) overflow error 441 in fldbld, by adding space for one extra \0. thanks to 442 robert bassett for spotting this one and providing a fix. 443 444 removed the files related to compilation on windows. i no 445 longer have anything like a current windows environment, so 446 i can't test any of it. 447 448May 23, 2010: 449 fixed long-standing overflow bug in run.c; many thanks to 450 nelson beebe for spotting it and providing the fix. 451 452 fixed bug that didn't parse -vd=1 properly; thanks to santiago 453 vila for spotting it. 454 455Feb 8, 2010: 456 i give up. replaced isblank with isspace in b.c; there are 457 no consistent header files. 458 459Nov 26, 2009: 460 fixed a long-standing issue with when FS takes effect. a 461 change to FS is now noticed immediately for subsequent splits. 462 463 changed the name getline() to awkgetline() to avoid yet another 464 name conflict somewhere. 465 466Feb 11, 2009: 467 temporarily for now defined HAS_ISBLANK, since that seems to 468 be the best way through the thicket. isblank arrived in C99, 469 but seems to be arriving at different systems at different 470 times. 471 472Oct 8, 2008: 473 fixed typo in b.c that set tmpvec wrongly. no one had ever 474 run into the problem, apparently. thanks to alistair crooks. 475 476Oct 23, 2007: 477 minor fix in lib.c: increase inputFS to 100, change malloc 478 for fields to n+1. 479 480 fixed memory fault caused by out of order test in setsval. 481 482 thanks to david o'brien, freebsd, for both fixes. 483 484May 1, 2007: 485 fiddle in makefile to fix for BSD make; thanks to igor sobrado. 486 487Mar 31, 2007: 488 fixed some null pointer refs calling adjbuf. 489 490Feb 21, 2007: 491 fixed a bug in matching the null RE in sub and gsub. thanks to al aho 492 who actually did the fix (in b.c), and to wolfgang seeberg for finding 493 it and providing a very compact test case. 494 495 fixed quotation in b.c; thanks to Hal Pratt and the Princeton Dante 496 Project. 497 498 removed some no-effect asserts in run.c. 499 500 fiddled maketab.c to not complain about bison-generated values. 501 502 removed the obsolete -V argument; fixed --version to print the 503 version and exit. 504 505 fixed wording and an outright error in the usage message; thanks to igor 506 sobrado and jason mcintyre. 507 508 fixed a bug in -d that caused core dump if no program followed. 509 510Jan 1, 2007: 511 dropped mac.code from makefile; there are few non-MacOSX 512 mac's these days. 513 514Jan 17, 2006: 515 system() not flagged as unsafe in the unadvertised -safe option. 516 found it while enhancing tests before shipping the ;login: article. 517 practice what you preach. 518 519 removed the 9-years-obsolete -mr and -mf flags. 520 521 added -version and --version options. 522 523 core dump on linux with BEGIN {nextfile}, now fixed. 524 525 removed some #ifdef's in run.c and lex.c that appear to no 526 longer be necessary. 527 528Apr 24, 2005: 529 modified lib.c so that values of $0 et al are preserved in the END 530 block, apparently as required by posix. thanks to havard eidnes 531 for the report and code. 532 533Jan 14, 2005: 534 fixed infinite loop in parsing, originally found by brian tsang. 535 thanks to arnold robbins for a suggestion that started me 536 rethinking it. 537 538Dec 31, 2004: 539 prevent overflow of -f array in main, head off potential error in 540 call of SYNTAX(), test malloc return in lib.c, all with thanks to 541 todd miller. 542 543Dec 22, 2004: 544 cranked up size of NCHARS; coverity thinks it can be overrun with 545 smaller size, and i think that's right. added some assertions to b.c 546 to catch places where it might overrun. the RE code is still fragile. 547 548Dec 5, 2004: 549 fixed a couple of overflow problems with ridiculous field numbers: 550 e.g., print $(2^32-1). thanks to ruslan ermilov, giorgos keramidas 551 and david o'brien at freebsd.org for patches. this really should 552 be re-done from scratch. 553 554Nov 21, 2004: 555 fixed another 25-year-old RE bug, in split. it's another failure 556 to (re-)initialize. thanks to steve fisher for spotting this and 557 providing a good test case. 558 559Nov 22, 2003: 560 fixed a bug in regular expressions that dates (so help me) from 1977; 561 it's been there from the beginning. an anchored longest match that 562 was longer than the number of states triggered a failure to initialize 563 the machine properly. many thanks to moinak ghosh for not only finding 564 this one but for providing a fix, in some of the most mysterious 565 code known to man. 566 567 fixed a storage leak in call() that appears to have been there since 568 1983 or so -- a function without an explicit return that assigns a 569 string to a parameter leaked a Cell. thanks to moinak ghosh for 570 spotting this very subtle one. 571 572Jul 31, 2003: 573 fixed, thanks to andrey chernov and ruslan ermilov, a bug in lex.c 574 that mis-handled the character 255 in input. (it was being compared 575 to EOF with a signed comparison.) 576 577Jul 29, 2003: 578 fixed (i think) the long-standing botch that included the beginning of 579 line state ^ for RE's in the set of valid characters; this led to a 580 variety of odd problems, including failure to properly match certain 581 regular expressions in non-US locales. thanks to ruslan for keeping 582 at this one. 583 584Jul 28, 2003: 585 n-th try at getting internationalization right, with thanks to volker 586 kiefel, arnold robbins and ruslan ermilov for advice, though they 587 should not be blamed for the outcome. according to posix, "." is the 588 radix character in programs and command line arguments regardless of 589 the locale; otherwise, the locale should prevail for input and output 590 of numbers. so it's intended to work that way. 591 592 i have rescinded the attempt to use strcoll in expanding shorthands in 593 regular expressions (cclenter). its properties are much too 594 surprising; for example [a-c] matches aAbBc in locale en_US but abBcC 595 in locale fr_CA. i can see how this might arise by implementation 596 but i cannot explain it to a human user. (this behavior can be seen 597 in gawk as well; we're leaning on the same library.) 598 599 the issue appears to be that strcoll is meant for sorting, where 600 merging upper and lower case may make sense (though note that unix 601 sort does not do this by default either). it is not appropriate 602 for regular expressions, where the goal is to match specific 603 patterns of characters. in any case, the notations [:lower:], etc., 604 are available in awk, and they are more likely to work correctly in 605 most locales. 606 607 a moratorium is hereby declared on internationalization changes. 608 i apologize to friends and colleagues in other parts of the world. 609 i would truly like to get this "right", but i don't know what 610 that is, and i do not want to keep making changes until it's clear. 611 612Jul 4, 2003: 613 fixed bug that permitted non-terminated RE, as in "awk /x". 614 615Jun 1, 2003: 616 subtle change to split: if source is empty, number of elems 617 is always 0 and the array is not set. 618 619Mar 21, 2003: 620 added some parens to isblank, in another attempt to make things 621 internationally portable. 622 623Mar 14, 2003: 624 the internationalization changes, somewhat modified, are now 625 reinstated. in theory awk will now do character comparisons 626 and case conversions in national language, but "." will always 627 be the decimal point separator on input and output regardless 628 of national language. isblank(){} has an #ifndef. 629 630 this no longer compiles on windows: LC_MESSAGES isn't defined 631 in vc6++. 632 633 fixed subtle behavior in field and record splitting: if FS is 634 a single character and RS is not empty, \n is NOT a separator. 635 this tortuous reading is found in the awk book; behavior now 636 matches gawk and mawk. 637 638Dec 13, 2002: 639 for the moment, the internationalization changes of nov 29 are 640 rolled back -- programs like x = 1.2 don't work in some locales, 641 because the parser is expecting x = 1,2. until i understand this 642 better, this will have to wait. 643 644Nov 29, 2002: 645 modified b.c (with tiny changes in main and run) to support 646 locales, using strcoll and iswhatever tests for posix character 647 classes. thanks to ruslan ermilov (ru@freebsd.org) for code. 648 the function isblank doesn't seem to have propagated to any 649 header file near me, so it's there explicitly. not properly 650 tested on non-ascii character sets by me. 651 652Jun 28, 2002: 653 modified run/format() and tran/getsval() to do a slightly better 654 job on using OFMT for output from print and CONVFMT for other 655 number->string conversions, as promised by posix and done by 656 gawk and mawk. there are still places where it doesn't work 657 right if CONVFMT is changed; by then the STR attribute of the 658 variable has been irrevocably set. thanks to arnold robbins for 659 code and examples. 660 661 fixed subtle bug in format that could get core dump. thanks to 662 Jaromir Dolecek <jdolecek@NetBSD.org> for finding and fixing. 663 minor cleanup in run.c / format() at the same time. 664 665 added some tests for null pointers to debugging printf's, which 666 were never intended for external consumption. thanks to dave 667 kerns (dkerns@lucent.com) for pointing this out. 668 669 GNU compatibility: an empty regexp matches anything (thanks to 670 dag-erling smorgrav, des@ofug.org). subject to reversion if 671 this does more harm than good. 672 673 pervasive small changes to make things more const-correct, as 674 reported by gcc's -Wwrite-strings. as it says in the gcc manual, 675 this may be more nuisance than useful. provoked by a suggestion 676 and code from arnaud desitter, arnaud@nimbus.geog.ox.ac.uk 677 678 minor documentation changes to note that this now compiles out 679 of the box on Mac OS X. 680 681Feb 10, 2002: 682 changed types in posix chars structure to quiet solaris cc. 683 684Jan 1, 2002: 685 fflush() or fflush("") flushes all files and pipes. 686 687 length(arrayname) returns number of elements; thanks to 688 arnold robbins for suggestion. 689 690 added a makefile.win to make it easier to build on windows. 691 based on dan allen's buildwin.bat. 692 693Nov 16, 2001: 694 added support for posix character class names like [:digit:], 695 which are not exactly shorter than [0-9] and perhaps no more 696 portable. thanks to dag-erling smorgrav for code. 697 698Feb 16, 2001: 699 removed -m option; no longer needed, and it was actually 700 broken (noted thanks to volker kiefel). 701 702Feb 10, 2001: 703 fixed an appalling bug in gettok: any sequence of digits, +,-, E, e, 704 and period was accepted as a valid number if it started with a period. 705 this would never have happened with the lex version. 706 707 other 1-character botches, now fixed, include a bare $ and a 708 bare " at the end of the input. 709 710Feb 7, 2001: 711 more (const char *) casts in b.c and tran.c to silence warnings. 712 713Nov 15, 2000: 714 fixed a bug introduced in august 1997 that caused expressions 715 like $f[1] to be syntax errors. thanks to arnold robbins for 716 noticing this and providing a fix. 717 718Oct 30, 2000: 719 fixed some nextfile bugs: not handling all cases. thanks to 720 arnold robbins for pointing this out. new regressions added. 721 722 close() is now a function. it returns whatever the library 723 fclose returns, and -1 for closing a file or pipe that wasn't 724 opened. 725 726Sep 24, 2000: 727 permit \n explicitly in character classes; won't work right 728 if comes in as "[\n]" but ok as /[\n]/, because of multiple 729 processing of \'s. thanks to arnold robbins. 730 731July 5, 2000: 732 minor fiddles in tran.c to keep compilers happy about uschar. 733 thanks to norman wilson. 734 735May 25, 2000: 736 yet another attempt at making 8-bit input work, with another 737 band-aid in b.c (member()), and some (uschar) casts to head 738 off potential errors in subscripts (like isdigit). also 739 changed HAT to NCHARS-2. thanks again to santiago vila. 740 741 changed maketab.c to ignore apparently out of range definitions 742 instead of halting; new freeBSD generates one. thanks to 743 jon snader <jsnader@ix.netcom.com> for pointing out the problem. 744 745May 2, 2000: 746 fixed an 8-bit problem in b.c by making several char*'s into 747 unsigned char*'s. not clear i have them all yet. thanks to 748 Santiago Vila <sanvila@unex.es> for the bug report. 749 750Apr 21, 2000: 751 finally found and fixed a memory leak in function call; it's 752 been there since functions were added ~1983. thanks to 753 jon bentley for the test case that found it. 754 755 added test in envinit to catch environment "variables" with 756 names beginning with '='; thanks to Berend Hasselman. 757 758Jul 28, 1999: 759 added test in defn() to catch function foo(foo), which 760 otherwise recurses until core dump. thanks to arnold 761 robbins for noticing this. 762 763Jun 20, 1999: 764 added *bp in gettok in lex.c; appears possible to exit function 765 without terminating the string. thanks to russ cox. 766 767Jun 2, 1999: 768 added function stdinit() to run to initialize files[] array, 769 in case stdin, etc., are not constants; some compilers care. 770 771May 10, 1999: 772 replaced the ERROR ... FATAL, etc., macros with functions 773 based on vprintf, to avoid problems caused by overrunning 774 fixed-size errbuf array. thanks to ralph corderoy for the 775 impetus, and for pointing out a string termination bug in 776 qstring as well. 777 778Apr 21, 1999: 779 fixed bug that caused occasional core dumps with commandline 780 variable with value ending in \. (thanks to nelson beebe for 781 the test case.) 782 783Apr 16, 1999: 784 with code kindly provided by Bruce Lilly, awk now parses 785 /=/ and similar constructs more sensibly in more places. 786 Bruce also provided some helpful test cases. 787 788Apr 5, 1999: 789 changed true/false to True/False in run.c to make it 790 easier to compile with C++. Added some casts on malloc 791 and realloc to be honest about casts; ditto. changed 792 ltype int to long in struct rrow to reduce some 64-bit 793 complaints; other changes scattered throughout for the 794 same purpose. thanks to Nelson Beebe for these portability 795 improvements. 796 797 removed some horrible pointer-int casting in b.c and elsewhere 798 by adding ptoi and itonp to localize the casts, which are 799 all benign. fixed one incipient bug that showed up on sgi 800 in 64-bit mode. 801 802 reset lineno for new source file; include filename in error 803 message. also fixed line number error in continuation lines. 804 (thanks to Nelson Beebe for both of these.) 805 806Mar 24, 1999: 807 Nelson Beebe notes that irix 5.3 yacc dies with a bogus 808 error; use a newer version or switch to bison, since sgi 809 is unlikely to fix it. 810 811Mar 5, 1999: 812 changed isnumber to is_number to avoid the problem caused by 813 versions of ctype.h that include the name isnumber. 814 815 distribution now includes a script for building on a Mac, 816 thanks to Dan Allen. 817 818Feb 20, 1999: 819 fixed memory leaks in run.c (call) and tran.c (setfval). 820 thanks to Stephen Nutt for finding these and providing the fixes. 821 822Jan 13, 1999: 823 replaced srand argument by (unsigned int) in run.c; 824 avoids problem on Mac and potentially on Unix & Windows. 825 thanks to Dan Allen. 826 827 added a few (int) casts to silence useless compiler warnings. 828 e.g., errorflag= in run.c jump(). 829 830 added proctab.c to the bundle outout; one less thing 831 to have to compile out of the box. 832 833 added calls to _popen and _pclose to the win95 stub for 834 pipes (thanks to Steve Adams for this helpful suggestion). 835 seems to work, though properties are not well understood 836 by me, and it appears that under some circumstances the 837 pipe output is truncated. Be careful. 838 839Oct 19, 1998: 840 fixed a couple of bugs in getrec: could fail to update $0 841 after a getline var; because inputFS wasn't initialized, 842 could split $0 on every character, a misleading diversion. 843 844 fixed caching bug in makedfa: LRU was actually removing 845 least often used. 846 847 thanks to ross ridge for finding these, and for providing 848 great bug reports. 849 850May 12, 1998: 851 fixed potential bug in readrec: might fail to update record 852 pointer after growing. thanks to dan levy for spotting this 853 and suggesting the fix. 854 855Mar 12, 1998: 856 added -V to print version number and die. 857 858[notify dave kerns, dkerns@dacsoup.ih.lucent.com] 859 860Feb 11, 1998: 861 subtle silent bug in lex.c: if the program ended with a number 862 longer than 1 digit, part of the input would be pushed back and 863 parsed again because token buffer wasn't terminated right. 864 example: awk 'length($0) > 10'. blush. at least i found it 865 myself. 866 867Aug 31, 1997: 868 s/adelete/awkdelete/: SGI uses this in malloc.h. 869 thanks to nelson beebe for pointing this one out. 870 871Aug 21, 1997: 872 fixed some bugs in sub and gsub when replacement includes \\. 873 this is a dark, horrible corner, but at least now i believe that 874 the behavior is the same as gawk and the intended posix standard. 875 thanks to arnold robbins for advice here. 876 877Aug 9, 1997: 878 somewhat regretfully, replaced the ancient lex-based lexical 879 analyzer with one written in C. it's longer, generates less code, 880 and more portable; the old one depended too much on mysterious 881 properties of lex that were not preserved in other environments. 882 in theory these recognize the same language. 883 884 now using strtod to test whether a string is a number, instead of 885 the convoluted original function. should be more portable and 886 reliable if strtod is implemented right. 887 888 removed now-pointless optimization in makefile that tries to avoid 889 recompilation when awkgram.y is changed but symbols are not. 890 891 removed most fixed-size arrays, though a handful remain, some 892 of which are unchecked. you have been warned. 893 894Aug 4, 1997: 895 with some trepidation, replaced the ancient code that managed 896 fields and $0 in fixed-size arrays with arrays that grow on 897 demand. there is still some tension between trying to make this 898 run fast and making it clean; not sure it's right yet. 899 900 the ill-conceived -mr and -mf arguments are now useful only 901 for debugging. previous dynamic string code removed. 902 903 numerous other minor cleanups along the way. 904 905Jul 30, 1997: 906 using code provided by dan levy (to whom profuse thanks), replaced 907 fixed-size arrays and awkward kludges by a fairly uniform mechanism 908 to grow arrays as needed for printf, sub, gsub, etc. 909 910Jul 23, 1997: 911 falling off the end of a function returns "" and 0, not 0. 912 thanks to arnold robbins. 913 914Jun 17, 1997: 915 replaced several fixed-size arrays by dynamically-created ones 916 in run.c; added overflow tests to some previously unchecked cases. 917 getline, toupper, tolower. 918 919 getline code is still broken in that recursive calls may wind 920 up using the same space. [fixed later] 921 922 increased RECSIZE to 8192 to push problems further over the horizon. 923 924 added \r to \n as input line separator for programs, not data. 925 damn CRLFs. 926 927 modified format() to permit explicit printf("%c", 0) to include 928 a null byte in output. thanks to ken stailey for the fix. 929 930 added a "-safe" argument that disables file output (print >, 931 print >>), process creation (cmd|getline, print |, system), and 932 access to the environment (ENVIRON). this is a first approximation 933 to a "safe" version of awk, but don't rely on it too much. thanks 934 to joan feigenbaum and matt blaze for the inspiration long ago. 935 936Jul 8, 1996: 937 fixed long-standing bug in sub, gsub(/a/, "\\\\&"); thanks to 938 ralph corderoy. 939 940Jun 29, 1996: 941 fixed awful bug in new field splitting; didn't get all the places 942 where input was done. 943 944Jun 28, 1996: 945 changed field-splitting to conform to posix definition: fields are 946 split using the value of FS at the time of input; it used to be 947 the value when the field or NF was first referred to, a much less 948 predictable definition. thanks to arnold robbins for encouragement 949 to do the right thing. 950 951May 28, 1996: 952 fixed appalling but apparently unimportant bug in parsing octal 953 numbers in reg exprs. 954 955 explicit hex in reg exprs now limited to 2 chars: \xa, \xaa. 956 957May 27, 1996: 958 cleaned up some declarations so gcc -Wall is now almost silent. 959 960 makefile now includes backup copies of ytab.c and lexyy.c in case 961 one makes before looking; it also avoids recreating lexyy.c unless 962 really needed. 963 964 s/aprintf/awkprint, s/asprintf/awksprintf/ to avoid some name clashes 965 with unwisely-written header files. 966 967 thanks to jeffrey friedl for several of these. 968 969May 26, 1996: 970 an attempt to rationalize the (unsigned) char issue. almost all 971 instances of unsigned char have been removed; the handful of places 972 in b.c where chars are used as table indices have been hand-crafted. 973 added some latin-1 tests to the regression, but i'm not confident; 974 none of my compilers seem to care much. thanks to nelson beebe for 975 pointing out some others that do care. 976 977May 2, 1996: 978 removed all register declarations. 979 980 enhanced split(), as in gawk, etc: split(s, a, "") splits s into 981 a[1]...a[length(s)] with each character a single element. 982 983 made the same changes for field-splitting if FS is "". 984 985 added nextfile, as in gawk: causes immediate advance to next 986 input file. (thanks to arnold robbins for inspiration and code). 987 988 small fixes to regexpr code: can now handle []], [[], and 989 variants; [] is now a syntax error, rather than matching 990 everything; [z-a] is now empty, not z. far from complete 991 or correct, however. (thanks to jeffrey friedl for pointing out 992 some awful behaviors.) 993 994Apr 29, 1996: 995 replaced uchar by uschar everywhere; apparently some compilers 996 usurp this name and this causes conflicts. 997 998 fixed call to time in run.c (bltin); arg is time_t *. 999 1000 replaced horrible pointer/long punning in b.c by a legitimate 1001 union. should be safer on 64-bit machines and cleaner everywhere. 1002 (thanks to nelson beebe for pointing out some of these problems.) 1003 1004 replaced nested comments by #if 0...#endif in run.c, lib.c. 1005 1006 removed getsval, setsval, execute macros from run.c and lib.c. 1007 machines are 100x faster than they were when these macros were 1008 first used. 1009 1010 revised filenames: awk.g.y => awkgram.y, awk.lx.l => awklex.l, 1011 y.tab.[ch] => ytab.[ch], lex.yy.c => lexyy.c, all in the aid of 1012 portability to nameless systems. 1013 1014 "make bundle" now includes yacc and lex output files for recipients 1015 who don't have yacc or lex. 1016 1017Aug 15, 1995: 1018 initialized Cells in setsymtab more carefully; some fields 1019 were not set. (thanks to purify, all of whose complaints i 1020 think i now understand.) 1021 1022 fixed at least one error in gsub that looked at -1-th element 1023 of an array when substituting for a null match (e.g., $). 1024 1025 delete arrayname is now legal; it clears the elements but leaves 1026 the array, which may not be the right behavior. 1027 1028 modified makefile: my current make can't cope with the test used 1029 to avoid unnecessary yacc invocations. 1030 1031Jul 17, 1995: 1032 added dynamically growing strings to awk.lx.l and b.c 1033 to permit regular expressions to be much bigger. 1034 the state arrays can still overflow. 1035 1036Aug 24, 1994: 1037 detect duplicate arguments in function definitions (mdm). 1038 1039May 11, 1994: 1040 trivial fix to printf to limit string size in sub(). 1041 1042Apr 22, 1994: 1043 fixed yet another subtle self-assignment problem: 1044 $1 = $2; $1 = $1 clobbered $1. 1045 1046 Regression tests now use private echo, to avoid quoting problems. 1047 1048Feb 2, 1994: 1049 changed error() to print line number as %d, not %g. 1050 1051Jul 23, 1993: 1052 cosmetic changes: increased sizes of some arrays, 1053 reworded some error messages. 1054 1055 added CONVFMT as in posix (just replaced OFMT in getsval) 1056 1057 FILENAME is now "" until the first thing that causes a file 1058 to be opened. 1059 1060Nov 28, 1992: 1061 deleted yyunput and yyoutput from proto.h; 1062 different versions of lex give these different declarations. 1063 1064May 31, 1992: 1065 added -mr N and -mf N options: more record and fields. 1066 these really ought to adjust automatically. 1067 1068 cleaned up some error messages; "out of space" now means 1069 malloc returned NULL in all cases. 1070 1071 changed rehash so that if it runs out, it just returns; 1072 things will continue to run slow, but maybe a bit longer. 1073 1074Apr 24, 1992: 1075 remove redundant close of stdin when using -f -. 1076 1077 got rid of core dump with -d; awk -d just prints date. 1078 1079Apr 12, 1992: 1080 added explicit check for /dev/std(in,out,err) in redirection. 1081 unlike gawk, no /dev/fd/n yet. 1082 1083 added (file/pipe) builtin. hard to test satisfactorily. 1084 not posix. 1085 1086Feb 20, 1992: 1087 recompile after abortive changes; should be unchanged. 1088 1089Dec 2, 1991: 1090 die-casting time: converted to ansi C, installed that. 1091 1092Nov 30, 1991: 1093 fixed storage leak in freefa, failing to recover [N]CCL. 1094 thanks to Bill Jones (jones@cs.usask.ca) 1095 1096Nov 19, 1991: 1097 use RAND_MAX instead of literal in builtin(). 1098 1099Nov 12, 1991: 1100 cranked up some fixed-size arrays in b.c, and added a test for 1101 overflow in penter. thanks to mark larsen. 1102 1103Sep 24, 1991: 1104 increased buffer in gsub. a very crude fix to a general problem. 1105 and again on Sep 26. 1106 1107Aug 18, 1991: 1108 enforce variable name syntax for commandline variables: has to 1109 start with letter or _. 1110 1111Jul 27, 1991: 1112 allow newline after ; in for statements. 1113 1114Jul 21, 1991: 1115 fixed so that in self-assignment like $1=$1, side effects 1116 like recomputing $0 take place. (this is getting subtle.) 1117 1118Jun 30, 1991: 1119 better test for detecting too-long output record. 1120 1121Jun 2, 1991: 1122 better defense against very long printf strings. 1123 made break and continue illegal outside of loops. 1124 1125May 13, 1991: 1126 removed extra arg on gettemp, tempfree. minor error message rewording. 1127 1128May 6, 1991: 1129 fixed silly bug in hex parsing in hexstr(). 1130 removed an apparently unnecessary test in isnumber(). 1131 warn about weird printf conversions. 1132 fixed unchecked array overwrite in relex(). 1133 1134 changed for (i in array) to access elements in sorted order. 1135 then unchanged it -- it really does run slower in too many cases. 1136 left the code in place, commented out. 1137 1138Feb 10, 1991: 1139 check error status on all writes, to avoid banging on full disks. 1140 1141Jan 28, 1991: 1142 awk -f - reads the program from stdin. 1143 1144Jan 11, 1991: 1145 failed to set numeric state on $0 in cmd|getline context in run.c. 1146 1147Nov 2, 1990: 1148 fixed sleazy test for integrality in getsval; use modf. 1149 1150Oct 29, 1990: 1151 fixed sleazy buggy code in lib.c that looked (incorrectly) for 1152 too long input lines. 1153 1154Oct 14, 1990: 1155 fixed the bug on p. 198 in which it couldn't deduce that an 1156 argument was an array in some contexts. replaced the error 1157 message in intest() by code that damn well makes it an array. 1158 1159Oct 8, 1990: 1160 fixed horrible bug: types and values were not preserved in 1161 some kinds of self-assignment. (in assign().) 1162 1163Aug 24, 1990: 1164 changed NCHARS to 256 to handle 8-bit characters in strings 1165 presented to match(), etc. 1166 1167Jun 26, 1990: 1168 changed struct rrow (awk.h) to use long instead of int for lval, 1169 since cfoll() stores a pointer in it. now works better when int's 1170 are smaller than pointers! 1171 1172May 6, 1990: 1173 AVA fixed the grammar so that ! is uniformly of the same precedence as 1174 unary + and -. This renders illegal some constructs like !x=y, which 1175 now has to be parenthesized as !(x=y), and makes others work properly: 1176 !x+y is (!x)+y, and x!y is x !y, not two pattern-action statements. 1177 (These problems were pointed out by Bob Lenk of Posix.) 1178 1179 Added \x to regular expressions (already in strings). 1180 Limited octal to octal digits; \8 and \9 are not octal. 1181 Centralized the code for parsing escapes in regular expressions. 1182 Added a bunch of tests to T.re and T.sub to verify some of this. 1183 1184Feb 9, 1990: 1185 fixed null pointer dereference bug in main.c: -F[nothing]. sigh. 1186 1187 restored srand behavior: it returns the current seed. 1188 1189Jan 18, 1990: 1190 srand now returns previous seed value (0 to start). 1191 1192Jan 5, 1990: 1193 fix potential problem in tran.c -- something was freed, 1194 then used in freesymtab. 1195 1196Oct 18, 1989: 1197 another try to get the max number of open files set with 1198 relatively machine-independent code. 1199 1200 small fix to input() in case of multiple reads after EOF. 1201 1202Oct 11, 1989: 1203 FILENAME is now defined in the BEGIN block -- too many old 1204 programs broke. 1205 1206 "-" means stdin in getline as well as on the commandline. 1207 1208 added a bunch of casts to the code to tell the truth about 1209 char * vs. unsigned char *, a right royal pain. added a 1210 setlocale call to the front of main, though probably no one 1211 has it usefully implemented yet. 1212 1213Aug 24, 1989: 1214 removed redundant relational tests against nullnode if parse 1215 tree already had a relational at that point. 1216 1217Aug 11, 1989: 1218 fixed bug: commandline variable assignment has to look like 1219 var=something. (consider the man page for =, in file =.1) 1220 1221 changed number of arguments to functions to static arrays 1222 to avoid repeated malloc calls. 1223 1224Aug 2, 1989: 1225 restored -F (space) separator 1226 1227Jul 30, 1989: 1228 added -v x=1 y=2 ... for immediate commandline variable assignment; 1229 done before the BEGIN block for sure. they have to precede the 1230 program if the program is on the commandline. 1231 Modified Aug 2 to require a separate -v for each assignment. 1232 1233Jul 10, 1989: 1234 fixed ref-thru-zero bug in environment code in tran.c 1235 1236Jun 23, 1989: 1237 add newline to usage message. 1238 1239Jun 14, 1989: 1240 added some missing ansi printf conversion letters: %i %X %E %G. 1241 no sensible meaning for h or L, so they may not do what one expects. 1242 1243 made %* conversions work. 1244 1245 changed x^y so that if n is a positive integer, it's done 1246 by explicit multiplication, thus achieving maximum accuracy. 1247 (this should be done by pow() but it seems not to be locally.) 1248 done to x ^= y as well. 1249 1250Jun 4, 1989: 1251 ENVIRON array contains environment: if shell variable V=thing, 1252 ENVIRON["V"] is "thing" 1253 1254 multiple -f arguments permitted. error reporting is naive. 1255 (they were permitted before, but only the last was used.) 1256 1257 fixed a really stupid botch in the debugging macro dprintf 1258 1259 fixed order of evaluation of commandline assignments to match 1260 what the book claims: an argument of the form x=e is evaluated 1261 at the time it would have been opened if it were a filename (p 63). 1262 this invalidates the suggested answer to ex 4-1 (p 195). 1263 1264 removed some code that permitted -F (space) fieldseparator, 1265 since it didn't quite work right anyway. (restored aug 2) 1266 1267Apr 27, 1989: 1268 Line number now accumulated correctly for comment lines. 1269 1270Apr 26, 1989: 1271 Debugging output now includes a version date, 1272 if one compiles it into the source each time. 1273 1274Apr 9, 1989: 1275 Changed grammar to prohibit constants as 3rd arg of sub and gsub; 1276 prevents class of overwriting-a-constant errors. (Last one?) 1277 This invalidates the "banana" example on page 43 of the book. 1278 1279 Added \a ("alert"), \v (vertical tab), \xhhh (hexadecimal), 1280 as in ANSI, for strings. Rescinded the sloppiness that permitted 1281 non-octal digits in \ooo. Warning: not all compilers and libraries 1282 will be able to deal with \x correctly. 1283 1284Jan 9, 1989: 1285 Fixed bug that caused tempcell list to contain a duplicate. 1286 The fix is kludgy. 1287 1288Dec 17, 1988: 1289 Catches some more commandline errors in main. 1290 Removed redundant decl of modf in run.c (confuses some compilers). 1291 Warning: there's no single declaration of malloc, etc., in awk.h 1292 that seems to satisfy all compilers. 1293 1294Dec 7, 1988: 1295 Added a bit of code to error printing to avoid printing nulls. 1296 (Not clear that it actually would.) 1297 1298Nov 27, 1988: 1299 With fear and trembling, modified the grammar to permit 1300 multiple pattern-action statements on one line without 1301 an explicit separator. By definition, this capitulation 1302 to the ghost of ancient implementations remains undefined 1303 and thus subject to change without notice or apology. 1304 DO NOT COUNT ON IT. 1305 1306Oct 30, 1988: 1307 Fixed bug in call() that failed to recover storage. 1308 1309 A warning is now generated if there are more arguments 1310 in the call than in the definition (in lieu of fixing 1311 another storage leak). 1312 1313Oct 20, 1988: 1314 Fixed %c: if expr is numeric, use numeric value; 1315 otherwise print 1st char of string value. still 1316 doesn't work if the value is 0 -- won't print \0. 1317 1318 Added a few more checks for running out of malloc. 1319 1320Oct 12, 1988: 1321 Fixed bug in call() that freed local arrays twice. 1322 1323 Fixed to handle deletion of non-existent array right; 1324 complains about attempt to delete non-array element. 1325 1326Sep 30, 1988: 1327 Now guarantees to evaluate all arguments of built-in 1328 functions, as in C; the appearance is that arguments 1329 are evaluated before the function is called. Places 1330 affected are sub (gsub was ok), substr, printf, and 1331 all the built-in arithmetic functions in bltin(). 1332 A warning is generated if a bltin() is called with 1333 the wrong number of arguments. 1334 1335 This requires changing makeprof on p167 of the book. 1336 1337Aug 23, 1988: 1338 setting FILENAME in BEGIN caused core dump, apparently 1339 because it was freeing space not allocated by malloc. 1340 1341July 24, 1988: 1342 fixed egregious error in toupper/tolower functions. 1343 still subject to rescinding, however. 1344 1345July 2, 1988: 1346 flush stdout before opening file or pipe 1347 1348July 2, 1988: 1349 performance bug in b.c/cgoto(): not freeing some sets of states. 1350 partial fix only right now, and the number of states increased 1351 to make it less obvious. 1352 1353June 1, 1988: 1354 check error status on close 1355 1356May 28, 1988: 1357 srand returns seed value it's using. 1358 see 1/18/90 1359 1360May 22, 1988: 1361 Removed limit on depth of function calls. 1362 1363May 10, 1988: 1364 Fixed lib.c to permit _ in commandline variable names. 1365 1366Mar 25, 1988: 1367 main.c fixed to recognize -- as terminator of command- 1368 line options. Illegal options flagged. 1369 Error reporting slightly cleaned up. 1370 1371Dec 2, 1987: 1372 Newer C compilers apply a strict scope rule to extern 1373 declarations within functions. Two extern declarations in 1374 lib.c and tran.c have been moved to obviate this problem. 1375 1376Oct xx, 1987: 1377 Reluctantly added toupper and tolower functions. 1378 Subject to rescinding without notice. 1379 1380Sep 17, 1987: 1381 Error-message printer had printf(s) instead of 1382 printf("%s",s); got core dumps when the message 1383 included a %. 1384 1385Sep 12, 1987: 1386 Very long printf strings caused core dump; 1387 fixed aprintf, asprintf, format to catch them. 1388 Can still get a core dump in printf itself. 1389 1390 1391