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 28Dec 13, 2002: 29 for the moment, the internationalization changes of nov 29 are 30 rolled back -- programs like x = 1.2 don't work in some locales, 31 because the parser is expecting x = 1,2. until i understand this 32 better, this will have to wait. 33 34Nov 29, 2002: 35 modified b.c (with tiny changes in main and run) to support 36 locales, using strcoll and iswhatever tests for posix character 37 classes. thanks to ruslan ermilov (ru@freebsd.org) for code. 38 the function isblank doesn't seem to have propagated to any 39 header file near me, so it's there explicitly. not properly 40 tested on non-ascii character sets by me. 41 42Jun 28, 2002: 43 modified run/format() and tran/getsval() to do a slightly better 44 job on using OFMT for output from print and CONVFMT for other 45 number->string conversions, as promised by posix and done by 46 gawk and mawk. there are still places where it doesn't work 47 right if CONVFMT is changed; by then the STR attribute of the 48 variable has been irrevocably set. thanks to arnold robbins for 49 code and examples. 50 51 fixed subtle bug in format that could get core dump. thanks to 52 Jaromir Dolecek <jdolecek@NetBSD.org> for finding and fixing. 53 minor cleanup in run.c / format() at the same time. 54 55 added some tests for null pointers to debugging printf's, which 56 were never intended for external consumption. thanks to dave 57 kerns (dkerns@lucent.com) for pointing this out. 58 59 GNU compatibility: an empty regexp matches anything (thanks to 60 dag-erling smorgrav, des@ofug.org). subject to reversion if 61 this does more harm than good. 62 63 pervasive small changes to make things more const-correct, as 64 reported by gcc's -Wwrite-strings. as it says in the gcc manual, 65 this may be more nuisance than useful. provoked by a suggestion 66 and code from arnaud desitter, arnaud@nimbus.geog.ox.ac.uk 67 68 minor documentation changes to note that this now compiles out 69 of the box on Mac OS X. 70 71Feb 10, 2002: 72 changed types in posix chars structure to quiet solaris cc. 73 74Jan 1, 2002: 75 fflush() or fflush("") flushes all files and pipes. 76 77 length(arrayname) returns number of elements; thanks to 78 arnold robbins for suggestion. 79 80 added a makefile.win to make it easier to build on windows. 81 based on dan allen's buildwin.bat. 82 83Nov 16, 2001: 84 added support for posix character class names like [:digit:], 85 which are not exactly shorter than [0-9] and perhaps no more 86 portable. thanks to dag-erling smorgrav for code. 87 88Feb 16, 2001: 89 removed -m option; no longer needed, and it was actually 90 broken (noted thanks to volker kiefel). 91 92Feb 10, 2001: 93 fixed an appalling bug in gettok: any sequence of digits, +,-, E, e, 94 and period was accepted as a valid number if it started with a period. 95 this would never have happened with the lex version. 96 97 other 1-character botches, now fixed, include a bare $ and a 98 bare " at the end of the input. 99 100Feb 7, 2001: 101 more (const char *) casts in b.c and tran.c to silence warnings. 102 103Nov 15, 2000: 104 fixed a bug introduced in august 1997 that caused expressions 105 like $f[1] to be syntax errors. thanks to arnold robbins for 106 noticing this and providing a fix. 107 108Oct 30, 2000: 109 fixed some nextfile bugs: not handling all cases. thanks to 110 arnold robbins for pointing this out. new regressions added. 111 112 close() is now a function. it returns whatever the library 113 fclose returns, and -1 for closing a file or pipe that wasn't 114 opened. 115 116Sep 24, 2000: 117 permit \n explicitly in character classes; won't work right 118 if comes in as "[\n]" but ok as /[\n]/, because of multiple 119 processing of \'s. thanks to arnold robbins. 120 121July 5, 2000: 122 minor fiddles in tran.c to keep compilers happy about uschar. 123 thanks to norman wilson. 124 125May 25, 2000: 126 yet another attempt at making 8-bit input work, with another 127 band-aid in b.c (member()), and some (uschar) casts to head 128 off potential errors in subscripts (like isdigit). also 129 changed HAT to NCHARS-2. thanks again to santiago vila. 130 131 changed maketab.c to ignore apparently out of range definitions 132 instead of halting; new freeBSD generates one. thanks to 133 jon snader <jsnader@ix.netcom.com> for pointing out the problem. 134 135May 2, 2000: 136 fixed an 8-bit problem in b.c by making several char*'s into 137 unsigned char*'s. not clear i have them all yet. thanks to 138 Santiago Vila <sanvila@unex.es> for the bug report. 139 140Apr 21, 2000: 141 finally found and fixed a memory leak in function call; it's 142 been there since functions were added ~1983. thanks to 143 jon bentley for the test case that found it. 144 145 added test in envinit to catch environment "variables" with 146 names begining with '='; thanks to Berend Hasselman. 147 148Jul 28, 1999: 149 added test in defn() to catch function foo(foo), which 150 otherwise recurses until core dump. thanks to arnold 151 robbins for noticing this. 152 153Jun 20, 1999: 154 added *bp in gettok in lex.c; appears possible to exit function 155 without terminating the string. thanks to russ cox. 156 157Jun 2, 1999: 158 added function stdinit() to run to initialize files[] array, 159 in case stdin, etc., are not constants; some compilers care. 160 161May 10, 1999: 162 replaced the ERROR ... FATAL, etc., macros with functions 163 based on vprintf, to avoid problems caused by overrunning 164 fixed-size errbuf array. thanks to ralph corderoy for the 165 impetus, and for pointing out a string termination bug in 166 qstring as well. 167 168Apr 21, 1999: 169 fixed bug that caused occasional core dumps with commandline 170 variable with value ending in \. (thanks to nelson beebe for 171 the test case.) 172 173Apr 16, 1999: 174 with code kindly provided by Bruce Lilly, awk now parses 175 /=/ and similar constructs more sensibly in more places. 176 Bruce also provided some helpful test cases. 177 178Apr 5, 1999: 179 changed true/false to True/False in run.c to make it 180 easier to compile with C++. Added some casts on malloc 181 and realloc to be honest about casts; ditto. changed 182 ltype int to long in struct rrow to reduce some 64-bit 183 complaints; other changes scattered throughout for the 184 same purpose. thanks to Nelson Beebe for these portability 185 improvements. 186 187 removed some horrible pointer-int casting in b.c and elsewhere 188 by adding ptoi and itonp to localize the casts, which are 189 all benign. fixed one incipient bug that showed up on sgi 190 in 64-bit mode. 191 192 reset lineno for new source file; include filename in error 193 message. also fixed line number error in continuation lines. 194 (thanks to Nelson Beebe for both of these.) 195 196Mar 24, 1999: 197 Nelson Beebe notes that irix 5.3 yacc dies with a bogus 198 error; use a newer version or switch to bison, since sgi 199 is unlikely to fix it. 200 201Mar 5, 1999: 202 changed isnumber to is_number to avoid the problem caused by 203 versions of ctype.h that include the name isnumber. 204 205 distribution now includes a script for building on a Mac, 206 thanks to Dan Allen. 207 208Feb 20, 1999: 209 fixed memory leaks in run.c (call) and tran.c (setfval). 210 thanks to Stephen Nutt for finding these and providing the fixes. 211 212Jan 13, 1999: 213 replaced srand argument by (unsigned int) in run.c; 214 avoids problem on Mac and potentially on Unix & Windows. 215 thanks to Dan Allen. 216 217 added a few (int) casts to silence useless compiler warnings. 218 e.g., errorflag= in run.c jump(). 219 220 added proctab.c to the bundle outout; one less thing 221 to have to compile out of the box. 222 223 added calls to _popen and _pclose to the win95 stub for 224 pipes (thanks to Steve Adams for this helpful suggestion). 225 seems to work, though properties are not well understood 226 by me, and it appears that under some circumstances the 227 pipe output is truncated. Be careful. 228 229Oct 19, 1998: 230 fixed a couple of bugs in getrec: could fail to update $0 231 after a getline var; because inputFS wasn't initialized, 232 could split $0 on every character, a misleading diversion. 233 234 fixed caching bug in makedfa: LRU was actually removing 235 least often used. 236 237 thanks to ross ridge for finding these, and for providing 238 great bug reports. 239 240May 12, 1998: 241 fixed potential bug in readrec: might fail to update record 242 pointer after growing. thanks to dan levy for spotting this 243 and suggesting the fix. 244 245Mar 12, 1998: 246 added -V to print version number and die. 247 248Feb 11, 1998: 249 subtle silent bug in lex.c: if the program ended with a number 250 longer than 1 digit, part of the input would be pushed back and 251 parsed again because token buffer wasn't terminated right. 252 example: awk 'length($0) > 10'. blush. at least i found it 253 myself. 254 255Aug 31, 1997: 256 s/adelete/awkdelete/: SGI uses this in malloc.h. 257 thanks to nelson beebe for pointing this one out. 258 259Aug 21, 1997: 260 fixed some bugs in sub and gsub when replacement includes \\. 261 this is a dark, horrible corner, but at least now i believe that 262 the behavior is the same as gawk and the intended posix standard. 263 thanks to arnold robbins for advice here. 264 265Aug 9, 1997: 266 somewhat regretfully, replaced the ancient lex-based lexical 267 analyzer with one written in C. it's longer, generates less code, 268 and more portable; the old one depended too much on mysterious 269 properties of lex that were not preserved in other environments. 270 in theory these recognize the same language. 271 272 now using strtod to test whether a string is a number, instead of 273 the convoluted original function. should be more portable and 274 reliable if strtod is implemented right. 275 276 removed now-pointless optimization in makefile that tries to avoid 277 recompilation when awkgram.y is changed but symbols are not. 278 279 removed most fixed-size arrays, though a handful remain, some 280 of which are unchecked. you have been warned. 281 282Aug 4, 1997: 283 with some trepidation, replaced the ancient code that managed 284 fields and $0 in fixed-size arrays with arrays that grow on 285 demand. there is still some tension between trying to make this 286 run fast and making it clean; not sure it's right yet. 287 288 the ill-conceived -mr and -mf arguments are now useful only 289 for debugging. previous dynamic string code removed. 290 291 numerous other minor cleanups along the way. 292 293Jul 30, 1997: 294 using code provided by dan levy (to whom profuse thanks), replaced 295 fixed-size arrays and awkward kludges by a fairly uniform mechanism 296 to grow arrays as needed for printf, sub, gsub, etc. 297 298Jul 23, 1997: 299 falling off the end of a function returns "" and 0, not 0. 300 thanks to arnold robbins. 301 302Jun 17, 1997: 303 replaced several fixed-size arrays by dynamically-created ones 304 in run.c; added overflow tests to some previously unchecked cases. 305 getline, toupper, tolower. 306 307 getline code is still broken in that recursive calls may wind 308 up using the same space. [fixed later] 309 310 increased RECSIZE to 8192 to push problems further over the horizon. 311 312 added \r to \n as input line separator for programs, not data. 313 damn CRLFs. 314 315 modified format() to permit explicit printf("%c", 0) to include 316 a null byte in output. thanks to ken stailey for the fix. 317 318 added a "-safe" argument that disables file output (print >, 319 print >>), process creation (cmd|getline, print |, system), and 320 access to the environment (ENVIRON). this is a first approximation 321 to a "safe" version of awk, but don't rely on it too much. thanks 322 to joan feigenbaum and matt blaze for the inspiration long ago. 323 324Jul 8, 1996: 325 fixed long-standing bug in sub, gsub(/a/, "\\\\&"); thanks to 326 ralph corderoy. 327 328Jun 29, 1996: 329 fixed awful bug in new field splitting; didn't get all the places 330 where input was done. 331 332Jun 28, 1996: 333 changed field-splitting to conform to posix definition: fields are 334 split using the value of FS at the time of input; it used to be 335 the value when the field or NF was first referred to, a much less 336 predictable definition. thanks to arnold robbins for encouragement 337 to do the right thing. 338 339May 28, 1996: 340 fixed appalling but apparently unimportant bug in parsing octal 341 numbers in reg exprs. 342 343 explicit hex in reg exprs now limited to 2 chars: \xa, \xaa. 344 345May 27, 1996: 346 cleaned up some declarations so gcc -Wall is now almost silent. 347 348 makefile now includes backup copies of ytab.c and lexyy.c in case 349 one makes before looking; it also avoids recreating lexyy.c unless 350 really needed. 351 352 s/aprintf/awkprint, s/asprintf/awksprintf/ to avoid some name clashes 353 with unwisely-written header files. 354 355 thanks to jeffrey friedl for several of these. 356 357May 26, 1996: 358 an attempt to rationalize the (unsigned) char issue. almost all 359 instances of unsigned char have been removed; the handful of places 360 in b.c where chars are used as table indices have been hand-crafted. 361 added some latin-1 tests to the regression, but i'm not confident; 362 none of my compilers seem to care much. thanks to nelson beebe for 363 pointing out some others that do care. 364 365May 2, 1996: 366 removed all register declarations. 367 368 enhanced split(), as in gawk, etc: split(s, a, "") splits s into 369 a[1]...a[length(s)] with each character a single element. 370 371 made the same changes for field-splitting if FS is "". 372 373 added nextfile, as in gawk: causes immediate advance to next 374 input file. (thanks to arnold robbins for inspiration and code). 375 376 small fixes to regexpr code: can now handle []], [[], and 377 variants; [] is now a syntax error, rather than matching 378 everything; [z-a] is now empty, not z. far from complete 379 or correct, however. (thanks to jeffrey friedl for pointing out 380 some awful behaviors.) 381 382Apr 29, 1996: 383 replaced uchar by uschar everwhere; apparently some compilers 384 usurp this name and this causes conflicts. 385 386 fixed call to time in run.c (bltin); arg is time_t *. 387 388 replaced horrible pointer/long punning in b.c by a legitimate 389 union. should be safer on 64-bit machines and cleaner everywhere. 390 (thanks to nelson beebe for pointing out some of these problems.) 391 392 replaced nested comments by #if 0...#endif in run.c, lib.c. 393 394 removed getsval, setsval, execute macros from run.c and lib.c. 395 machines are 100x faster than they were when these macros were 396 first used. 397 398 revised filenames: awk.g.y => awkgram.y, awk.lx.l => awklex.l, 399 y.tab.[ch] => ytab.[ch], lex.yy.c => lexyy.c, all in the aid of 400 portability to nameless systems. 401 402 "make bundle" now includes yacc and lex output files for recipients 403 who don't have yacc or lex. 404 405Aug 15, 1995: 406 initialized Cells in setsymtab more carefully; some fields 407 were not set. (thanks to purify, all of whose complaints i 408 think i now understand.) 409 410 fixed at least one error in gsub that looked at -1-th element 411 of an array when substituting for a null match (e.g., $). 412 413 delete arrayname is now legal; it clears the elements but leaves 414 the array, which may not be the right behavior. 415 416 modified makefile: my current make can't cope with the test used 417 to avoid unnecessary yacc invocations. 418 419Jul 17, 1995: 420 added dynamically growing strings to awk.lx.l and b.c 421 to permit regular expressions to be much bigger. 422 the state arrays can still overflow. 423 424Aug 24, 1994: 425 detect duplicate arguments in function definitions (mdm). 426 427May 11, 1994: 428 trivial fix to printf to limit string size in sub(). 429 430Apr 22, 1994: 431 fixed yet another subtle self-assignment problem: 432 $1 = $2; $1 = $1 clobbered $1. 433 434 Regression tests now use private echo, to avoid quoting problems. 435 436Feb 2, 1994: 437 changed error() to print line number as %d, not %g. 438 439Jul 23, 1993: 440 cosmetic changes: increased sizes of some arrays, 441 reworded some error messages. 442 443 added CONVFMT as in posix (just replaced OFMT in getsval) 444 445 FILENAME is now "" until the first thing that causes a file 446 to be opened. 447 448Nov 28, 1992: 449 deleted yyunput and yyoutput from proto.h; 450 different versions of lex give these different declarations. 451 452May 31, 1992: 453 added -mr N and -mf N options: more record and fields. 454 these really ought to adjust automatically. 455 456 cleaned up some error messages; "out of space" now means 457 malloc returned NULL in all cases. 458 459 changed rehash so that if it runs out, it just returns; 460 things will continue to run slow, but maybe a bit longer. 461 462Apr 24, 1992: 463 remove redundant close of stdin when using -f -. 464 465 got rid of core dump with -d; awk -d just prints date. 466 467Apr 12, 1992: 468 added explicit check for /dev/std(in,out,err) in redirection. 469 unlike gawk, no /dev/fd/n yet. 470 471 added (file/pipe) builtin. hard to test satisfactorily. 472 not posix. 473 474Feb 20, 1992: 475 recompile after abortive changes; should be unchanged. 476 477Dec 2, 1991: 478 die-casting time: converted to ansi C, installed that. 479 480Nov 30, 1991: 481 fixed storage leak in freefa, failing to recover [N]CCL. 482 thanks to Bill Jones (jones@cs.usask.ca) 483 484Nov 19, 1991: 485 use RAND_MAX instead of literal in builtin(). 486 487Nov 12, 1991: 488 cranked up some fixed-size arrays in b.c, and added a test for 489 overflow in penter. thanks to mark larsen. 490 491Sep 24, 1991: 492 increased buffer in gsub. a very crude fix to a general problem. 493 and again on Sep 26. 494 495Aug 18, 1991: 496 enforce variable name syntax for commandline variables: has to 497 start with letter or _. 498 499Jul 27, 1991: 500 allow newline after ; in for statements. 501 502Jul 21, 1991: 503 fixed so that in self-assignment like $1=$1, side effects 504 like recomputing $0 take place. (this is getting subtle.) 505 506Jun 30, 1991: 507 better test for detecting too-long output record. 508 509Jun 2, 1991: 510 better defense against very long printf strings. 511 made break and continue illegal outside of loops. 512 513May 13, 1991: 514 removed extra arg on gettemp, tempfree. minor error message rewording. 515 516May 6, 1991: 517 fixed silly bug in hex parsing in hexstr(). 518 removed an apparently unnecessary test in isnumber(). 519 warn about weird printf conversions. 520 fixed unchecked array overwrite in relex(). 521 522 changed for (i in array) to access elements in sorted order. 523 then unchanged it -- it really does run slower in too many cases. 524 left the code in place, commented out. 525 526Feb 10, 1991: 527 check error status on all writes, to avoid banging on full disks. 528 529Jan 28, 1991: 530 awk -f - reads the program from stdin. 531 532Jan 11, 1991: 533 failed to set numeric state on $0 in cmd|getline context in run.c. 534 535Nov 2, 1990: 536 fixed sleazy test for integrality in getsval; use modf. 537 538Oct 29, 1990: 539 fixed sleazy buggy code in lib.c that looked (incorrectly) for 540 too long input lines. 541 542Oct 14, 1990: 543 fixed the bug on p. 198 in which it couldn't deduce that an 544 argument was an array in some contexts. replaced the error 545 message in intest() by code that damn well makes it an array. 546 547Oct 8, 1990: 548 fixed horrible bug: types and values were not preserved in 549 some kinds of self-assignment. (in assign().) 550 551Aug 24, 1990: 552 changed NCHARS to 256 to handle 8-bit characters in strings 553 presented to match(), etc. 554 555Jun 26, 1990: 556 changed struct rrow (awk.h) to use long instead of int for lval, 557 since cfoll() stores a pointer in it. now works better when int's 558 are smaller than pointers! 559 560May 6, 1990: 561 AVA fixed the grammar so that ! is uniformly of the same precedence as 562 unary + and -. This renders illegal some constructs like !x=y, which 563 now has to be parenthesized as !(x=y), and makes others work properly: 564 !x+y is (!x)+y, and x!y is x !y, not two pattern-action statements. 565 (These problems were pointed out by Bob Lenk of Posix.) 566 567 Added \x to regular expressions (already in strings). 568 Limited octal to octal digits; \8 and \9 are not octal. 569 Centralized the code for parsing escapes in regular expressions. 570 Added a bunch of tests to T.re and T.sub to verify some of this. 571 572Feb 9, 1990: 573 fixed null pointer dereference bug in main.c: -F[nothing]. sigh. 574 575 restored srand behavior: it returns the current seed. 576 577Jan 18, 1990: 578 srand now returns previous seed value (0 to start). 579 580Jan 5, 1990: 581 fix potential problem in tran.c -- something was freed, 582 then used in freesymtab. 583 584Oct 18, 1989: 585 another try to get the max number of open files set with 586 relatively machine-independent code. 587 588 small fix to input() in case of multiple reads after EOF. 589 590Oct 11, 1989: 591 FILENAME is now defined in the BEGIN block -- too many old 592 programs broke. 593 594 "-" means stdin in getline as well as on the commandline. 595 596 added a bunch of casts to the code to tell the truth about 597 char * vs. unsigned char *, a right royal pain. added a 598 setlocale call to the front of main, though probably no one 599 has it usefully implemented yet. 600 601Aug 24, 1989: 602 removed redundant relational tests against nullnode if parse 603 tree already had a relational at that point. 604 605Aug 11, 1989: 606 fixed bug: commandline variable assignment has to look like 607 var=something. (consider the man page for =, in file =.1) 608 609 changed number of arguments to functions to static arrays 610 to avoid repeated malloc calls. 611 612Aug 2, 1989: 613 restored -F (space) separator 614 615Jul 30, 1989: 616 added -v x=1 y=2 ... for immediate commandline variable assignment; 617 done before the BEGIN block for sure. they have to precede the 618 program if the program is on the commandline. 619 Modified Aug 2 to require a separate -v for each assignment. 620 621Jul 10, 1989: 622 fixed ref-thru-zero bug in environment code in tran.c 623 624Jun 23, 1989: 625 add newline to usage message. 626 627Jun 14, 1989: 628 added some missing ansi printf conversion letters: %i %X %E %G. 629 no sensible meaning for h or L, so they may not do what one expects. 630 631 made %* conversions work. 632 633 changed x^y so that if n is a positive integer, it's done 634 by explicit multiplication, thus achieving maximum accuracy. 635 (this should be done by pow() but it seems not to be locally.) 636 done to x ^= y as well. 637 638Jun 4, 1989: 639 ENVIRON array contains environment: if shell variable V=thing, 640 ENVIRON["V"] is "thing" 641 642 multiple -f arguments permitted. error reporting is naive. 643 (they were permitted before, but only the last was used.) 644 645 fixed a really stupid botch in the debugging macro dprintf 646 647 fixed order of evaluation of commandline assignments to match 648 what the book claims: an argument of the form x=e is evaluated 649 at the time it would have been opened if it were a filename (p 63). 650 this invalidates the suggested answer to ex 4-1 (p 195). 651 652 removed some code that permitted -F (space) fieldseparator, 653 since it didn't quite work right anyway. (restored aug 2) 654 655Apr 27, 1989: 656 Line number now accumulated correctly for comment lines. 657 658Apr 26, 1989: 659 Debugging output now includes a version date, 660 if one compiles it into the source each time. 661 662Apr 9, 1989: 663 Changed grammar to prohibit constants as 3rd arg of sub and gsub; 664 prevents class of overwriting-a-constant errors. (Last one?) 665 This invalidates the "banana" example on page 43 of the book. 666 667 Added \a ("alert"), \v (vertical tab), \xhhh (hexadecimal), 668 as in ANSI, for strings. Rescinded the sloppiness that permitted 669 non-octal digits in \ooo. Warning: not all compilers and libraries 670 will be able to deal with \x correctly. 671 672Jan 9, 1989: 673 Fixed bug that caused tempcell list to contain a duplicate. 674 The fix is kludgy. 675 676Dec 17, 1988: 677 Catches some more commandline errors in main. 678 Removed redundant decl of modf in run.c (confuses some compilers). 679 Warning: there's no single declaration of malloc, etc., in awk.h 680 that seems to satisfy all compilers. 681 682Dec 7, 1988: 683 Added a bit of code to error printing to avoid printing nulls. 684 (Not clear that it actually would.) 685 686Nov 27, 1988: 687 With fear and trembling, modified the grammar to permit 688 multiple pattern-action statements on one line without 689 an explicit separator. By definition, this capitulation 690 to the ghost of ancient implementations remains undefined 691 and thus subject to change without notice or apology. 692 DO NOT COUNT ON IT. 693 694Oct 30, 1988: 695 Fixed bug in call() that failed to recover storage. 696 697 A warning is now generated if there are more arguments 698 in the call than in the definition (in lieu of fixing 699 another storage leak). 700 701Oct 20, 1988: 702 Fixed %c: if expr is numeric, use numeric value; 703 otherwise print 1st char of string value. still 704 doesn't work if the value is 0 -- won't print \0. 705 706 Added a few more checks for running out of malloc. 707 708Oct 12, 1988: 709 Fixed bug in call() that freed local arrays twice. 710 711 Fixed to handle deletion of non-existent array right; 712 complains about attempt to delete non-array element. 713 714Sep 30, 1988: 715 Now guarantees to evaluate all arguments of built-in 716 functions, as in C; the appearance is that arguments 717 are evaluated before the function is called. Places 718 affected are sub (gsub was ok), substr, printf, and 719 all the built-in arithmetic functions in bltin(). 720 A warning is generated if a bltin() is called with 721 the wrong number of arguments. 722 723 This requires changing makeprof on p167 of the book. 724 725Aug 23, 1988: 726 setting FILENAME in BEGIN caused core dump, apparently 727 because it was freeing space not allocated by malloc. 728 729July 24, 1988: 730 fixed egregious error in toupper/tolower functions. 731 still subject to rescinding, however. 732 733July 2, 1988: 734 flush stdout before opening file or pipe 735 736July 2, 1988: 737 performance bug in b.c/cgoto(): not freeing some sets of states. 738 partial fix only right now, and the number of states increased 739 to make it less obvious. 740 741June 1, 1988: 742 check error status on close 743 744May 28, 1988: 745 srand returns seed value it's using. 746 see 1/18/90 747 748May 22, 1988: 749 Removed limit on depth of function calls. 750 751May 10, 1988: 752 Fixed lib.c to permit _ in commandline variable names. 753 754Mar 25, 1988: 755 main.c fixed to recognize -- as terminator of command- 756 line options. Illegal options flagged. 757 Error reporting slightly cleaned up. 758 759Dec 2, 1987: 760 Newer C compilers apply a strict scope rule to extern 761 declarations within functions. Two extern declarations in 762 lib.c and tran.c have been moved to obviate this problem. 763 764Oct xx, 1987: 765 Reluctantly added toupper and tolower functions. 766 Subject to rescinding without notice. 767 768Sep 17, 1987: 769 Error-message printer had printf(s) instead of 770 printf("%s",s); got core dumps when the message 771 included a %. 772 773Sep 12, 1987: 774 Very long printf strings caused core dump; 775 fixed aprintf, asprintf, format to catch them. 776 Can still get a core dump in printf itself. 777 778 779