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