185587Sobrien/****************************************************************
285587SobrienCopyright (C) Lucent Technologies 1997
385587SobrienAll Rights Reserved
485587Sobrien
585587SobrienPermission to use, copy, modify, and distribute this software and
685587Sobrienits documentation for any purpose and without fee is hereby
785587Sobriengranted, provided that the above copyright notice appear in all
885587Sobriencopies and that both that the copyright notice and this
985587Sobrienpermission notice and warranty disclaimer appear in supporting
1085587Sobriendocumentation, and that the name Lucent Technologies or any of
1185587Sobrienits entities not be used in advertising or publicity pertaining
1285587Sobriento distribution of the software without specific, written prior
1385587Sobrienpermission.
1485587Sobrien
1585587SobrienLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1685587SobrienINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
1785587SobrienIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
1885587SobrienSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1985587SobrienWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
2085587SobrienIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
2185587SobrienARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
2285587SobrienTHIS SOFTWARE.
2385587Sobrien****************************************************************/
2485587Sobrien
2585587SobrienThis file lists all bug fixes, changes, etc., made since the AWK book
2685587Sobrienwas sent to the printers in August, 1987.
2785587Sobrien
28244988SdelphijDec 20, 2012:
29244988Sdelphij	fiddled makefile to get correct yacc and bison flags.  pick yacc
30244988Sdelphij	(linux) or bison (mac) as necessary.
31244988Sdelphij
32244988Sdelphij	added  __attribute__((__noreturn__)) to a couple of lines in
33244988Sdelphij	proto.h, to silence someone's enthusiastic checker.
34244988Sdelphij
35244988Sdelphij	fixed obscure call by value bug in split(a[1],a) reported on
36244988Sdelphij	9fans.  the management of temporary values is just a mess; i
37244988Sdelphij	took a shortcut by making an extra string copy.  thanks
38244988Sdelphij	to paul patience and arnold robbins for passing it on and for
39244988Sdelphij	proposed patches.
40244988Sdelphij
41244988Sdelphij	tiny fiddle in setfval to eliminate -0 results in T.expr, which
42244988Sdelphij	has irritated me for 20+ years.
43244988Sdelphij
44224776SruAug 10, 2011:
45224776Sru	another fix to avoid core dump with delete(ARGV); again, many thanks
46224776Sru	to ruslan ermilov.
47224776Sru
48224731SruAug 7, 2011:
49224731Sru	split(s, a, //) now behaves the same as split(s, a, "")
50224731Sru
51224731SruJun 12, 2011:
52224731Sru	/pat/, \n /pat/ {...} is now legal, though bad style to use.
53224731Sru
54224731Sru	added checks to new -v code that permits -vnospace; thanks to
55224731Sru	ruslan ermilov for spotting this and providing the patch. 
56224731Sru
57224731Sru	removed fixed limit on number of open files; thanks to aleksey
58224731Sru	cheusov and christos zoulos. 
59224731Sru
60224731Sru	fixed day 1 bug that resurrected deleted elements of ARGV when
61224731Sru	used as filenames (in lib.c).
62224731Sru
63224731Sru	minor type fiddles to make gcc -Wall -pedantic happier (but not
64224731Sru	totally so); turned on -fno-strict-aliasing in makefile.
65224731Sru
66221533SruMay 6, 2011:
67221533Sru	added #ifdef for isblank.
68221533Sru	now allows -ffoo as well as -f foo arguments.
69221533Sru	(thanks, ruslan)
70221533Sru
71221381SruMay 1, 2011:
72221381Sru	after advice from todd miller, kevin lo, ruslan ermilov,
73221381Sru	and arnold robbins, changed srand() to return the previous
74221381Sru	seed (which is 1 on the first call of srand).  the seed is
75221381Sru	an Awkfloat internally though converted to unsigned int to
76221381Sru	pass to the library srand().  thanks, everyone. 
77221381Sru
78221381Sru	fixed a subtle (and i hope low-probability) overflow error
79221381Sru	in fldbld, by adding space for one extra \0.  thanks to 
80221381Sru	robert bassett for spotting this one and providing a fix.
81221381Sru
82221381Sru	removed the files related to compilation on windows.  i no
83221381Sru	longer have anything like a current windows environment, so
84221381Sru	i can't test any of it.
85221381Sru
86221381SruMay 23, 2010:
87221381Sru	fixed long-standing overflow bug in run.c; many thanks to
88221381Sru	nelson beebe for spotting it and providing the fix.
89221381Sru
90221381Sru	fixed bug that didn't parse -vd=1 properly; thanks to santiago
91221381Sru	vila for spotting it.
92221381Sru
93221381SruFeb 8, 2010:
94221381Sru	i give up.  replaced isblank with isspace in b.c; there are
95221381Sru	no consistent header files.
96221381Sru
97201951SruNov 26, 2009:
98201951Sru	fixed a long-standing issue with when FS takes effect.  a
99201951Sru	change to FS is now noticed immediately for subsequent splits.
100201951Sru
101201951Sru	changed the name getline() to awkgetline() to avoid yet another
102201951Sru	name conflict somewhere.
103201951Sru
104201951SruFeb 11, 2009:
105201951Sru	temporarily for now defined HAS_ISBLANK, since that seems to
106201951Sru	be the best way through the thicket.  isblank arrived in C99,
107201951Sru	but seems to be arriving at different systems at different
108201951Sru	times.
109201951Sru
110201951SruOct 8, 2008:
111201951Sru	fixed typo in b.c that set tmpvec wrongly.  no one had ever
112201951Sru	run into the problem, apparently.  thanks to alistair crooks.
113201951Sru
114172958SobrienOct 23, 2007:
115172958Sobrien	minor fix in lib.c: increase inputFS to 100, change malloc
116172958Sobrien	for fields to n+1.  
117172958Sobrien
118172958Sobrien	fixed memory fault caused by out of order test in setsval.
119172958Sobrien
120172958Sobrien	thanks to david o'brien, freebsd, for both fixes.
121172958Sobrien
122170331SrafanMay 1, 2007:
123170331Srafan	fiddle in makefile to fix for BSD make; thanks to igor sobrado.
124170331Srafan
125170331SrafanMar 31, 2007:
126170331Srafan	fixed some null pointer refs calling adjbuf.
127170331Srafan
128170331SrafanFeb 21, 2007:
129170331Srafan	fixed a bug in matching the null RE in sub and gsub.  thanks to al aho
130170331Srafan	who actually did the fix (in b.c), and to wolfgang seeberg for finding
131170331Srafan	it and providing a very compact test case.
132170331Srafan
133170331Srafan	fixed quotation in b.c; thanks to Hal Pratt and the Princeton Dante
134170331Srafan	Project.
135170331Srafan
136170331Srafan	removed some no-effect asserts in run.c.
137170331Srafan
138170331Srafan	fiddled maketab.c to not complain about bison-generated values.
139170331Srafan
140170331Srafan	removed the obsolete -V argument; fixed --version to print the
141170331Srafan	version and exit.
142170331Srafan
143170331Srafan	fixed wording and an outright error in the usage message; thanks to igor
144170331Srafan	sobrado and jason mcintyre.
145170331Srafan
146170331Srafan	fixed a bug in -d that caused core dump if no program followed.
147170331Srafan
148170331SrafanJan 1, 2007:
149170331Srafan	dropped mac.code from makefile; there are few non-MacOSX
150170331Srafan	mac's these days.
151170331Srafan
152170331SrafanJan 17, 2006:
153170331Srafan	system() not flagged as unsafe in the unadvertised -safe option.
154170331Srafan	found it while enhancing tests before shipping the ;login: article.
155170331Srafan	practice what you preach.
156170331Srafan
157170331Srafan	removed the 9-years-obsolete -mr and -mf flags.
158170331Srafan
159170331Srafan	added -version and --version options.
160170331Srafan
161170331Srafan	core dump on linux with BEGIN {nextfile}, now fixed.
162170331Srafan
163170331Srafan	removed some #ifdef's in run.c and lex.c that appear to no 
164170331Srafan	longer be necessary.
165170331Srafan
166146299SruApr 24, 2005:
167146299Sru	modified lib.c so that values of $0 et al are preserved in the END
168146299Sru	block, apparently as required by posix.  thanks to havard eidnes
169146299Sru	for the report and code.
170146299Sru
171146299SruJan 14, 2005:
172146299Sru	fixed infinite loop in parsing, originally found by brian tsang.
173146299Sru	thanks to arnold robbins for a suggestion that started me
174146299Sru	rethinking it.
175146299Sru
176146299SruDec 31, 2004:
177146299Sru	prevent overflow of -f array in main, head off potential error in 
178146299Sru	call of SYNTAX(), test malloc return in lib.c, all with thanks to 
179146299Sru	todd miller.
180146299Sru
181146299SruDec 22, 2004:
182146299Sru	cranked up size of NCHARS; coverity thinks it can be overrun with
183146299Sru	smaller size, and i think that's right.  added some assertions to b.c
184146299Sru	to catch places where it might overrun.  the RE code is still fragile.
185146299Sru
186146299SruDec 5, 2004:
187146299Sru	fixed a couple of overflow problems with ridiculous field numbers:
188146299Sru	e.g., print $(2^32-1).  thanks to ruslan ermilov, giorgos keramidas
189146299Sru	and david o'brien at freebsd.org for patches.  this really should
190146299Sru	be re-done from scratch.
191146299Sru
192146299SruNov 21, 2004:
193146299Sru	fixed another 25-year-old RE bug, in split.  it's another failure
194146299Sru	to (re-)initialize.  thanks to steve fisher for spotting this and
195146299Sru	providing a good test case.
196146299Sru
197125601SruNov 22, 2003:
198125601Sru	fixed a bug in regular expressions that dates (so help me) from 1977;
199125601Sru	it's been there from the beginning.  an anchored longest match that
200125601Sru	was longer than the number of states triggered a failure to initialize
201125601Sru	the machine properly.  many thanks to moinak ghosh for not only finding
202125601Sru	this one but for providing a fix, in some of the most mysterious
203125601Sru	code known to man.
204125601Sru
205125601Sru	fixed a storage leak in call() that appears to have been there since
206125601Sru	1983 or so -- a function without an explicit return that assigns a 
207125601Sru	string to a parameter leaked a Cell.  thanks to moinak ghosh for 
208125601Sru	spotting this very subtle one.
209125601Sru
210125601SruJul 31, 2003:
211125601Sru	fixed, thanks to andrey chernov and ruslan ermilov, a bug in lex.c
212125601Sru	that mis-handled the character 255 in input.  (it was being compared
213125601Sru	to EOF with a signed comparison.)
214125601Sru
215118194SruJul 29, 2003:
216118194Sru	fixed (i think) the long-standing botch that included the beginning of
217118194Sru	line state ^ for RE's in the set of valid characters; this led to a
218118194Sru	variety of odd problems, including failure to properly match certain
219118194Sru	regular expressions in non-US locales.  thanks to ruslan for keeping
220118194Sru	at this one.
221118194Sru
222118194SruJul 28, 2003:
223118194Sru	n-th try at getting internationalization right, with thanks to volker
224118194Sru	kiefel, arnold robbins and ruslan ermilov for advice, though they
225118194Sru	should not be blamed for the outcome.  according to posix, "."  is the
226118194Sru	radix character in programs and command line arguments regardless of
227118194Sru	the locale; otherwise, the locale should prevail for input and output
228118194Sru	of numbers.  so it's intended to work that way.
229118194Sru	
230118194Sru	i have rescinded the attempt to use strcoll in expanding shorthands in
231118194Sru	regular expressions (cclenter).  its properties are much too
232118194Sru	surprising; for example [a-c] matches aAbBc in locale en_US but abBcC
233118194Sru	in locale fr_CA.  i can see how this might arise by implementation
234118194Sru	but i cannot explain it to a human user.  (this behavior can be seen
235118194Sru	in gawk as well; we're leaning on the same library.)
236118194Sru
237118194Sru	the issue appears to be that strcoll is meant for sorting, where
238118194Sru	merging upper and lower case may make sense (though note that unix
239118194Sru	sort does not do this by default either).  it is not appropriate
240118194Sru	for regular expressions, where the goal is to match specific
241118194Sru	patterns of characters.  in any case, the notations [:lower:], etc.,
242118194Sru	are available in awk, and they are more likely to work correctly in
243118194Sru	most locales.
244118194Sru
245118194Sru	a moratorium is hereby declared on internationalization changes.
246118194Sru	i apologize to friends and colleagues in other parts of the world.
247118194Sru	i would truly like to get this "right", but i don't know what
248118194Sru	that is, and i do not want to keep making changes until it's clear.
249118194Sru
250118194SruJul 4, 2003:
251118194Sru	fixed bug that permitted non-terminated RE, as in "awk /x".
252118194Sru
253118194SruJun 1, 2003:
254118194Sru	subtle change to split: if source is empty, number of elems
255118194Sru	is always 0 and the array is not set.
256118194Sru
257118194SruMar 21, 2003:
258118194Sru	added some parens to isblank, in another attempt to make things
259118194Sru	internationally portable.
260118194Sru
261112336SobrienMar 14, 2003:
262112336Sobrien	the internationalization changes, somewhat modified, are now
263112336Sobrien	reinstated.  in theory awk will now do character comparisons
264112336Sobrien	and case conversions in national language, but "." will always
265112336Sobrien	be the decimal point separator on input and output regardless
266112336Sobrien	of national language.  isblank(){} has an #ifndef.
267112336Sobrien
268112336Sobrien	this no longer compiles on windows: LC_MESSAGES isn't defined
269112336Sobrien	in vc6++.
270112336Sobrien
271112336Sobrien	fixed subtle behavior in field and record splitting: if FS is
272112336Sobrien	a single character and RS is not empty, \n is NOT a separator.
273112336Sobrien	this tortuous reading is found in the awk book; behavior now
274112336Sobrien	matches gawk and mawk.
275112336Sobrien
276108072SobrienDec 13, 2002:
277108072Sobrien	for the moment, the internationalization changes of nov 29 are
278108072Sobrien	rolled back -- programs like x = 1.2 don't work in some locales,
279108072Sobrien	because the parser is expecting x = 1,2.  until i understand this
280108072Sobrien	better, this will have to wait.
281108072Sobrien
282107806SobrienNov 29, 2002:
283107806Sobrien	modified b.c (with tiny changes in main and run) to support
284107806Sobrien	locales, using strcoll and iswhatever tests for posix character
285107806Sobrien	classes.  thanks to ruslan ermilov (ru@freebsd.org) for code.
286107806Sobrien	the function isblank doesn't seem to have propagated to any
287107806Sobrien	header file near me, so it's there explicitly.  not properly
288107806Sobrien	tested on non-ascii character sets by me.
289107806Sobrien
290107806SobrienJun 28, 2002:
291107806Sobrien	modified run/format() and tran/getsval() to do a slightly better
292107806Sobrien	job on using OFMT for output from print and CONVFMT for other
293107806Sobrien	number->string conversions, as promised by posix and done by 
294107806Sobrien	gawk and mawk.  there are still places where it doesn't work
295107806Sobrien	right if CONVFMT is changed; by then the STR attribute of the
296107806Sobrien	variable has been irrevocably set.  thanks to arnold robbins for
297107806Sobrien	code and examples.
298107806Sobrien
299107806Sobrien	fixed subtle bug in format that could get core dump.  thanks to
300107806Sobrien	Jaromir Dolecek <jdolecek@NetBSD.org> for finding and fixing.
301107806Sobrien	minor cleanup in run.c / format() at the same time.
302107806Sobrien
303107806Sobrien	added some tests for null pointers to debugging printf's, which
304107806Sobrien	were never intended for external consumption.  thanks to dave
305107806Sobrien	kerns (dkerns@lucent.com) for pointing this out.
306107806Sobrien
307107806Sobrien	GNU compatibility: an empty regexp matches anything (thanks to
308107806Sobrien	dag-erling smorgrav, des@ofug.org).  subject to reversion if
309107806Sobrien	this does more harm than good.
310107806Sobrien
311107806Sobrien	pervasive small changes to make things more const-correct, as
312107806Sobrien	reported by gcc's -Wwrite-strings.  as it says in the gcc manual,
313107806Sobrien	this may be more nuisance than useful.  provoked by a suggestion
314107806Sobrien	and code from arnaud desitter, arnaud@nimbus.geog.ox.ac.uk
315107806Sobrien
316107806Sobrien	minor documentation changes to note that this now compiles out
317107806Sobrien	of the box on Mac OS X.
318107806Sobrien
31990902SdesFeb 10, 2002:
32090902Sdes	changed types in posix chars structure to quiet solaris cc.
32190902Sdes
32290902SdesJan 1, 2002:
32390902Sdes	fflush() or fflush("") flushes all files and pipes.
32490902Sdes
32590902Sdes	length(arrayname) returns number of elements; thanks to 
32690902Sdes	arnold robbins for suggestion.
32790902Sdes
32890902Sdes	added a makefile.win to make it easier to build on windows.
32990902Sdes	based on dan allen's buildwin.bat.
33090902Sdes
33190902SdesNov 16, 2001:
33290902Sdes	added support for posix character class names like [:digit:],
33390902Sdes	which are not exactly shorter than [0-9] and perhaps no more
33490902Sdes	portable.  thanks to dag-erling smorgrav for code.
33590902Sdes
33690902SdesFeb 16, 2001:
33790902Sdes	removed -m option; no longer needed, and it was actually
33890902Sdes	broken (noted thanks to volker kiefel).
33990902Sdes
34090902SdesFeb 10, 2001:
34190902Sdes	fixed an appalling bug in gettok: any sequence of digits, +,-, E, e,
34290902Sdes	and period was accepted as a valid number if it started with a period.
34390902Sdes	this would never have happened with the lex version.
34490902Sdes
34590902Sdes	other 1-character botches, now fixed, include a bare $ and a
34690902Sdes	bare " at the end of the input.
34790902Sdes
34890902SdesFeb 7, 2001:
34990902Sdes	more (const char *) casts in b.c and tran.c to silence warnings.
35090902Sdes
35185587SobrienNov 15, 2000:
35285587Sobrien	fixed a bug introduced in august 1997 that caused expressions
35385587Sobrien	like $f[1] to be syntax errors.  thanks to arnold robbins for
35485587Sobrien	noticing this and providing a fix.
35585587Sobrien
35685587SobrienOct 30, 2000:
35785587Sobrien	fixed some nextfile bugs: not handling all cases.  thanks to
35885587Sobrien	arnold robbins for pointing this out.  new regressions added.
35985587Sobrien
36085587Sobrien	close() is now a function.  it returns whatever the library
36185587Sobrien	fclose returns, and -1 for closing a file or pipe that wasn't
36285587Sobrien	opened.
36385587Sobrien
36485587SobrienSep 24, 2000:
36585587Sobrien	permit \n explicitly in character classes; won't work right
36685587Sobrien	if comes in as "[\n]" but ok as /[\n]/, because of multiple
36785587Sobrien	processing of \'s.  thanks to arnold robbins.
36885587Sobrien
36985587SobrienJuly 5, 2000:
37085587Sobrien	minor fiddles in tran.c to keep compilers happy about uschar.
37185587Sobrien	thanks to norman wilson.
37285587Sobrien
37385587SobrienMay 25, 2000:
37485587Sobrien	yet another attempt at making 8-bit input work, with another
37585587Sobrien	band-aid in b.c (member()), and some (uschar) casts to head 
37685587Sobrien	off potential errors in subscripts (like isdigit).  also
37785587Sobrien	changed HAT to NCHARS-2.  thanks again to santiago vila.
37885587Sobrien
37985587Sobrien	changed maketab.c to ignore apparently out of range definitions
38085587Sobrien	instead of halting; new freeBSD generates one.  thanks to
38185587Sobrien	jon snader <jsnader@ix.netcom.com> for pointing out the problem.
38285587Sobrien
38385587SobrienMay 2, 2000:
38485587Sobrien	fixed an 8-bit problem in b.c by making several char*'s into
38585587Sobrien	unsigned char*'s.  not clear i have them all yet.  thanks to
38685587Sobrien	Santiago Vila <sanvila@unex.es> for the bug report.
38785587Sobrien
38885587SobrienApr 21, 2000:
38985587Sobrien	finally found and fixed a memory leak in function call; it's
39085587Sobrien	been there since functions were added ~1983.  thanks to
39185587Sobrien	jon bentley for the test case that found it.
39285587Sobrien
39385587Sobrien	added test in envinit to catch environment "variables" with
394146299Sru	names beginning with '='; thanks to Berend Hasselman.
39585587Sobrien
39685587SobrienJul 28, 1999:
39785587Sobrien	added test in defn() to catch function foo(foo), which
39885587Sobrien	otherwise recurses until core dump.  thanks to arnold
39985587Sobrien	robbins for noticing this.
40085587Sobrien
40185587SobrienJun 20, 1999:
40285587Sobrien	added *bp in gettok in lex.c; appears possible to exit function
40385587Sobrien	without terminating the string.  thanks to russ cox.
40485587Sobrien
40585587SobrienJun 2, 1999:
40685587Sobrien	added function stdinit() to run to initialize files[] array,
40785587Sobrien	in case stdin, etc., are not constants; some compilers care.
40885587Sobrien
40985587SobrienMay 10, 1999:
41085587Sobrien	replaced the ERROR ... FATAL, etc., macros with functions
41185587Sobrien	based on vprintf, to avoid problems caused by overrunning
41285587Sobrien	fixed-size errbuf array.  thanks to ralph corderoy for the
41385587Sobrien	impetus, and for pointing out a string termination bug in
41485587Sobrien	qstring as well.
41585587Sobrien
41685587SobrienApr 21, 1999:
41785587Sobrien	fixed bug that caused occasional core dumps with commandline
41885587Sobrien	variable with value ending in \.  (thanks to nelson beebe for
41985587Sobrien	the test case.)
42085587Sobrien
42185587SobrienApr 16, 1999:
42285587Sobrien	with code kindly provided by Bruce Lilly, awk now parses 
42385587Sobrien	/=/ and similar constructs more sensibly in more places.
42485587Sobrien	Bruce also provided some helpful test cases.
42585587Sobrien
42685587SobrienApr 5, 1999:
42785587Sobrien	changed true/false to True/False in run.c to make it
42885587Sobrien	easier to compile with C++.  Added some casts on malloc
42985587Sobrien	and realloc to be honest about casts; ditto.  changed
43085587Sobrien	ltype int to long in struct rrow to reduce some 64-bit
43185587Sobrien	complaints; other changes scattered throughout for the
43285587Sobrien	same purpose.  thanks to Nelson Beebe for these portability
43385587Sobrien	improvements.
43485587Sobrien
43585587Sobrien	removed some horrible pointer-int casting in b.c and elsewhere
43685587Sobrien	by adding ptoi and itonp to localize the casts, which are
43785587Sobrien	all benign.  fixed one incipient bug that showed up on sgi
43885587Sobrien	in 64-bit mode.
43985587Sobrien
44085587Sobrien	reset lineno for new source file; include filename in error
44185587Sobrien	message.  also fixed line number error in continuation lines.
44285587Sobrien	(thanks to Nelson Beebe for both of these.)
44385587Sobrien
44485587SobrienMar 24, 1999:
44585587Sobrien	Nelson Beebe notes that irix 5.3 yacc dies with a bogus
44685587Sobrien	error; use a newer version or switch to bison, since sgi
44785587Sobrien	is unlikely to fix it.
44885587Sobrien
44985587SobrienMar 5, 1999:
45085587Sobrien	changed isnumber to is_number to avoid the problem caused by
45185587Sobrien	versions of ctype.h that include the name isnumber.
45285587Sobrien
45385587Sobrien	distribution now includes a script for building on a Mac,
45485587Sobrien	thanks to Dan Allen.
45585587Sobrien
45685587SobrienFeb 20, 1999:
45785587Sobrien	fixed memory leaks in run.c (call) and tran.c (setfval).
45885587Sobrien	thanks to Stephen Nutt for finding these and providing the fixes.
45985587Sobrien
46085587SobrienJan 13, 1999:
46185587Sobrien	replaced srand argument by (unsigned int) in run.c;
46285587Sobrien	avoids problem on Mac and potentially on Unix & Windows.
46385587Sobrien	thanks to Dan Allen.
46485587Sobrien
46585587Sobrien	added a few (int) casts to silence useless compiler warnings.
46685587Sobrien	e.g., errorflag= in run.c jump().
46785587Sobrien
46885587Sobrien	added proctab.c to the bundle outout; one less thing
46985587Sobrien	to have to compile out of the box.
47085587Sobrien
47185587Sobrien	added calls to _popen and _pclose to the win95 stub for
47285587Sobrien	pipes (thanks to Steve Adams for this helpful suggestion).
47385587Sobrien	seems to work, though properties are not well understood
47485587Sobrien	by me, and it appears that under some circumstances the
47585587Sobrien	pipe output is truncated.  Be careful.
47685587Sobrien
47785587SobrienOct 19, 1998:
47885587Sobrien	fixed a couple of bugs in getrec: could fail to update $0
47985587Sobrien	after a getline var; because inputFS wasn't initialized, 
48085587Sobrien	could split $0 on every character, a misleading diversion.
48185587Sobrien
48285587Sobrien	fixed caching bug in makedfa: LRU was actually removing
48385587Sobrien	least often used.
48485587Sobrien
48585587Sobrien	thanks to ross ridge for finding these, and for providing
48685587Sobrien	great bug reports.
48785587Sobrien
48885587SobrienMay 12, 1998:
48985587Sobrien	fixed potential bug in readrec: might fail to update record
49085587Sobrien	pointer after growing.  thanks to dan levy for spotting this
49185587Sobrien	and suggesting the fix.
49285587Sobrien
49385587SobrienMar 12, 1998:
49485587Sobrien	added -V to print version number and die.
49585587Sobrien
49685587SobrienFeb 11, 1998:
49785587Sobrien	subtle silent bug in lex.c: if the program ended with a number
49885587Sobrien	longer than 1 digit, part of the input would be pushed back and
49985587Sobrien	parsed again because token buffer wasn't terminated right.
50085587Sobrien	example:  awk 'length($0) > 10'.  blush.  at least i found it
50185587Sobrien	myself.
50285587Sobrien
50385587SobrienAug 31, 1997:
50485587Sobrien	s/adelete/awkdelete/: SGI uses this in malloc.h.
50585587Sobrien	thanks to nelson beebe for pointing this one out.
50685587Sobrien
50785587SobrienAug 21, 1997:
50885587Sobrien	fixed some bugs in sub and gsub when replacement includes \\.
50985587Sobrien	this is a dark, horrible corner, but at least now i believe that
51085587Sobrien	the behavior is the same as gawk and the intended posix standard.
51185587Sobrien	thanks to arnold robbins for advice here.
51285587Sobrien
51385587SobrienAug 9, 1997:
51485587Sobrien	somewhat regretfully, replaced the ancient lex-based lexical
51585587Sobrien	analyzer with one written in C.  it's longer, generates less code,
51685587Sobrien	and more portable; the old one depended too much on mysterious
51785587Sobrien	properties of lex that were not preserved in other environments.
51885587Sobrien	in theory these recognize the same language.
51985587Sobrien
52085587Sobrien	now using strtod to test whether a string is a number, instead of
52185587Sobrien	the convoluted original function.  should be more portable and
52285587Sobrien	reliable if strtod is implemented right.
52385587Sobrien
52485587Sobrien	removed now-pointless optimization in makefile that tries to avoid
52585587Sobrien	recompilation when awkgram.y is changed but symbols are not.
52685587Sobrien
52785587Sobrien	removed most fixed-size arrays, though a handful remain, some
52885587Sobrien	of which are unchecked.  you have been warned.
52985587Sobrien
53085587SobrienAug 4, 1997:
53185587Sobrien	with some trepidation, replaced the ancient code that managed
53285587Sobrien	fields and $0 in fixed-size arrays with arrays that grow on
53385587Sobrien	demand.  there is still some tension between trying to make this
53485587Sobrien	run fast and making it clean; not sure it's right yet.
53585587Sobrien
53685587Sobrien	the ill-conceived -mr and -mf arguments are now useful only
53785587Sobrien	for debugging.  previous dynamic string code removed.
53885587Sobrien
53985587Sobrien	numerous other minor cleanups along the way.
54085587Sobrien
54185587SobrienJul 30, 1997:
54285587Sobrien	using code provided by dan levy (to whom profuse thanks), replaced
54385587Sobrien	fixed-size arrays and awkward kludges by a fairly uniform mechanism
54485587Sobrien	to grow arrays as needed for printf, sub, gsub, etc.
54585587Sobrien
54685587SobrienJul 23, 1997:
54785587Sobrien	falling off the end of a function returns "" and 0, not 0.
54885587Sobrien	thanks to arnold robbins.
54985587Sobrien
55085587SobrienJun 17, 1997:
55185587Sobrien	replaced several fixed-size arrays by dynamically-created ones
55285587Sobrien	in run.c; added overflow tests to some previously unchecked cases.
55385587Sobrien	getline, toupper, tolower.
55485587Sobrien
55585587Sobrien	getline code is still broken in that recursive calls may wind
55685587Sobrien	up using the same space.  [fixed later]
55785587Sobrien
55885587Sobrien	increased RECSIZE to 8192 to push problems further over the horizon.
55985587Sobrien
56085587Sobrien	added \r to \n as input line separator for programs, not data.
56185587Sobrien	damn CRLFs.
56285587Sobrien
56385587Sobrien	modified format() to permit explicit printf("%c", 0) to include
56485587Sobrien	a null byte in output.  thanks to ken stailey for the fix.
56585587Sobrien
56685587Sobrien	added a "-safe" argument that disables file output (print >,
56785587Sobrien	print >>), process creation (cmd|getline, print |, system), and
56885587Sobrien	access to the environment (ENVIRON).  this is a first approximation
56985587Sobrien	to a "safe" version of awk, but don't rely on it too much.  thanks
57085587Sobrien	to joan feigenbaum and matt blaze for the inspiration long ago.
57185587Sobrien
57285587SobrienJul 8, 1996:
57385587Sobrien	fixed long-standing bug in sub, gsub(/a/, "\\\\&"); thanks to
57485587Sobrien	ralph corderoy.
57585587Sobrien
57685587SobrienJun 29, 1996:
57785587Sobrien	fixed awful bug in new field splitting; didn't get all the places
57885587Sobrien	where input was done.
57985587Sobrien
58085587SobrienJun 28, 1996:
58185587Sobrien	changed field-splitting to conform to posix definition: fields are
58285587Sobrien	split using the value of FS at the time of input; it used to be
58385587Sobrien	the value when the field or NF was first referred to, a much less
58485587Sobrien	predictable definition.  thanks to arnold robbins for encouragement
58585587Sobrien	to do the right thing.
58685587Sobrien
58785587SobrienMay 28, 1996:
58885587Sobrien	fixed appalling but apparently unimportant bug in parsing octal
58985587Sobrien	numbers in reg exprs.
59085587Sobrien
59185587Sobrien	explicit hex in reg exprs now limited to 2 chars: \xa, \xaa.
59285587Sobrien
59385587SobrienMay 27, 1996:
59485587Sobrien	cleaned up some declarations so gcc -Wall is now almost silent.
59585587Sobrien
59685587Sobrien	makefile now includes backup copies of ytab.c and lexyy.c in case
59785587Sobrien	one makes before looking; it also avoids recreating lexyy.c unless
59885587Sobrien	really needed.
59985587Sobrien
60085587Sobrien	s/aprintf/awkprint, s/asprintf/awksprintf/ to avoid some name clashes
60185587Sobrien	with unwisely-written header files.
60285587Sobrien
60385587Sobrien	thanks to jeffrey friedl for several of these.
60485587Sobrien
60585587SobrienMay 26, 1996:
60685587Sobrien	an attempt to rationalize the (unsigned) char issue.  almost all
60785587Sobrien	instances of unsigned char have been removed; the handful of places
60885587Sobrien	in b.c where chars are used as table indices have been hand-crafted.
60985587Sobrien	added some latin-1 tests to the regression, but i'm not confident;
61085587Sobrien	none of my compilers seem to care much.  thanks to nelson beebe for
61185587Sobrien	pointing out some others that do care.
61285587Sobrien
61385587SobrienMay 2, 1996:
61485587Sobrien	removed all register declarations.
61585587Sobrien
61685587Sobrien	enhanced split(), as in gawk, etc:  split(s, a, "") splits s into
61785587Sobrien	a[1]...a[length(s)] with each character a single element.
61885587Sobrien
61985587Sobrien	made the same changes for field-splitting if FS is "".
62085587Sobrien
62185587Sobrien	added nextfile, as in gawk: causes immediate advance to next
62285587Sobrien	input file. (thanks to arnold robbins for inspiration and code).
62385587Sobrien
62485587Sobrien	small fixes to regexpr code:  can now handle []], [[], and
62585587Sobrien	variants;  [] is now a syntax error, rather than matching 
62685587Sobrien	everything;  [z-a] is now empty, not z.  far from complete
62785587Sobrien	or correct, however.  (thanks to jeffrey friedl for pointing out
62885587Sobrien	some awful behaviors.)
62985587Sobrien
63085587SobrienApr 29, 1996:
631146299Sru	replaced uchar by uschar everywhere; apparently some compilers
63285587Sobrien	usurp this name and this causes conflicts.
63385587Sobrien
63485587Sobrien	fixed call to time in run.c (bltin); arg is time_t *.
63585587Sobrien
63685587Sobrien	replaced horrible pointer/long punning in b.c by a legitimate
63785587Sobrien	union.  should be safer on 64-bit machines and cleaner everywhere.
63885587Sobrien	(thanks to nelson beebe for pointing out some of these problems.)
63985587Sobrien
64085587Sobrien	replaced nested comments by #if 0...#endif in run.c, lib.c.
64185587Sobrien
64285587Sobrien	removed getsval, setsval, execute macros from run.c and lib.c.
64385587Sobrien	machines are 100x faster than they were when these macros were
64485587Sobrien	first used.
64585587Sobrien
64685587Sobrien	revised filenames: awk.g.y => awkgram.y, awk.lx.l => awklex.l,
64785587Sobrien	y.tab.[ch] => ytab.[ch], lex.yy.c => lexyy.c, all in the aid of
64885587Sobrien	portability to nameless systems.
64985587Sobrien
65085587Sobrien	"make bundle" now includes yacc and lex output files for recipients
65185587Sobrien	who don't have yacc or lex.
65285587Sobrien
65385587SobrienAug 15, 1995:
65485587Sobrien	initialized Cells in setsymtab more carefully; some fields
65585587Sobrien	were not set.  (thanks to purify, all of whose complaints i
65685587Sobrien	think i now understand.)
65785587Sobrien
65885587Sobrien	fixed at least one error in gsub that looked at -1-th element
65985587Sobrien	of an array when substituting for a null match (e.g., $).
66085587Sobrien
66185587Sobrien	delete arrayname is now legal; it clears the elements but leaves
66285587Sobrien	the array, which may not be the right behavior.
66385587Sobrien
66485587Sobrien	modified makefile: my current make can't cope with the test used
66585587Sobrien	to avoid unnecessary yacc invocations.
66685587Sobrien
66785587SobrienJul 17, 1995:
66885587Sobrien	added dynamically growing strings to awk.lx.l and b.c
66985587Sobrien	to permit regular expressions to be much bigger.
67085587Sobrien	the state arrays can still overflow.
67185587Sobrien
67285587SobrienAug 24, 1994:
67385587Sobrien	detect duplicate arguments in function definitions (mdm).
67485587Sobrien
67585587SobrienMay 11, 1994:
67685587Sobrien	trivial fix to printf to limit string size in sub().
67785587Sobrien
67885587SobrienApr 22, 1994:
67985587Sobrien	fixed yet another subtle self-assignment problem:
68085587Sobrien	$1 = $2; $1 = $1 clobbered $1.
68185587Sobrien
68285587Sobrien	Regression tests now use private echo, to avoid quoting problems.
68385587Sobrien
68485587SobrienFeb 2, 1994:
68585587Sobrien	changed error() to print line number as %d, not %g.
68685587Sobrien
68785587SobrienJul 23, 1993:
68885587Sobrien	cosmetic changes: increased sizes of some arrays,
68985587Sobrien	reworded some error messages.
69085587Sobrien
69185587Sobrien	added CONVFMT as in posix (just replaced OFMT in getsval)
69285587Sobrien
69385587Sobrien	FILENAME is now "" until the first thing that causes a file
69485587Sobrien	to be opened.
69585587Sobrien
69685587SobrienNov 28, 1992:
69785587Sobrien	deleted yyunput and yyoutput from proto.h;
69885587Sobrien	different versions of lex give these different declarations.
69985587Sobrien
70085587SobrienMay 31, 1992:
70185587Sobrien	added -mr N and -mf N options: more record and fields.
70285587Sobrien	these really ought to adjust automatically.
70385587Sobrien
70485587Sobrien	cleaned up some error messages; "out of space" now means
70585587Sobrien	malloc returned NULL in all cases.
70685587Sobrien
70785587Sobrien	changed rehash so that if it runs out, it just returns;
70885587Sobrien	things will continue to run slow, but maybe a bit longer.
70985587Sobrien
71085587SobrienApr 24, 1992:
71185587Sobrien	remove redundant close of stdin when using -f -.
71285587Sobrien
71385587Sobrien	got rid of core dump with -d; awk -d just prints date.
71485587Sobrien
71585587SobrienApr 12, 1992:
71685587Sobrien	added explicit check for /dev/std(in,out,err) in redirection.
71785587Sobrien	unlike gawk, no /dev/fd/n yet.
71885587Sobrien
71985587Sobrien	added (file/pipe) builtin.  hard to test satisfactorily.
72085587Sobrien	not posix.
72185587Sobrien
72285587SobrienFeb 20, 1992:
72385587Sobrien	recompile after abortive changes;  should be unchanged.
72485587Sobrien
72585587SobrienDec 2, 1991:
72685587Sobrien	die-casting time:  converted to ansi C, installed that.
72785587Sobrien
72885587SobrienNov 30, 1991:
72985587Sobrien	fixed storage leak in freefa, failing to recover [N]CCL.
73085587Sobrien	thanks to Bill Jones (jones@cs.usask.ca)
73185587Sobrien
73285587SobrienNov 19, 1991:
73385587Sobrien	use RAND_MAX instead of literal in builtin().
73485587Sobrien
73585587SobrienNov 12, 1991:
73685587Sobrien	cranked up some fixed-size arrays in b.c, and added a test for
73785587Sobrien	overflow in penter.  thanks to mark larsen.
73885587Sobrien
73985587SobrienSep 24, 1991:
74085587Sobrien	increased buffer in gsub.  a very crude fix to a general problem.
74185587Sobrien	and again on Sep 26.
74285587Sobrien
74385587SobrienAug 18, 1991:
74485587Sobrien	enforce variable name syntax for commandline variables: has to
74585587Sobrien	start with letter or _.
74685587Sobrien
74785587SobrienJul 27, 1991:
74885587Sobrien	allow newline after ; in for statements.
74985587Sobrien
75085587SobrienJul 21, 1991:
75185587Sobrien	fixed so that in self-assignment like $1=$1, side effects
75285587Sobrien	like recomputing $0 take place.  (this is getting subtle.)
75385587Sobrien
75485587SobrienJun 30, 1991:
75585587Sobrien	better test for detecting too-long output record.
75685587Sobrien
75785587SobrienJun 2, 1991:
75885587Sobrien	better defense against very long printf strings.
75985587Sobrien	made break and continue illegal outside of loops.
76085587Sobrien
76185587SobrienMay 13, 1991:
76285587Sobrien	removed extra arg on gettemp, tempfree.  minor error message rewording.
76385587Sobrien
76485587SobrienMay 6, 1991:
76585587Sobrien	fixed silly bug in hex parsing in hexstr().
76685587Sobrien	removed an apparently unnecessary test in isnumber().
76785587Sobrien	warn about weird printf conversions.
76885587Sobrien	fixed unchecked array overwrite in relex().
76985587Sobrien
77085587Sobrien	changed for (i in array) to access elements in sorted order.
77185587Sobrien	then unchanged it -- it really does run slower in too many cases.
77285587Sobrien	left the code in place, commented out.
77385587Sobrien
77485587SobrienFeb 10, 1991:
77585587Sobrien	check error status on all writes, to avoid banging on full disks.
77685587Sobrien
77785587SobrienJan 28, 1991:
77885587Sobrien	awk -f - reads the program from stdin.
77985587Sobrien
78085587SobrienJan 11, 1991:
78185587Sobrien	failed to set numeric state on $0 in cmd|getline context in run.c.
78285587Sobrien
78385587SobrienNov 2, 1990:
78485587Sobrien	fixed sleazy test for integrality in getsval;  use modf.
78585587Sobrien
78685587SobrienOct 29, 1990:
78785587Sobrien	fixed sleazy buggy code in lib.c that looked (incorrectly) for
78885587Sobrien	too long input lines.
78985587Sobrien
79085587SobrienOct 14, 1990:
79185587Sobrien	fixed the bug on p. 198 in which it couldn't deduce that an
79285587Sobrien	argument was an array in some contexts.  replaced the error
79385587Sobrien	message in intest() by code that damn well makes it an array.
79485587Sobrien
79585587SobrienOct 8, 1990:
79685587Sobrien	fixed horrible bug:  types and values were not preserved in
79785587Sobrien	some kinds of self-assignment. (in assign().)
79885587Sobrien
79985587SobrienAug 24, 1990:
80085587Sobrien	changed NCHARS to 256 to handle 8-bit characters in strings
80185587Sobrien	presented to match(), etc.
80285587Sobrien
80385587SobrienJun 26, 1990:
80485587Sobrien	changed struct rrow (awk.h) to use long instead of int for lval,
80585587Sobrien	since cfoll() stores a pointer in it.  now works better when int's
80685587Sobrien	are smaller than pointers!
80785587Sobrien
80885587SobrienMay 6, 1990:
80985587Sobrien	AVA fixed the grammar so that ! is uniformly of the same precedence as
81085587Sobrien	unary + and -.  This renders illegal some constructs like !x=y, which
81185587Sobrien	now has to be parenthesized as !(x=y), and makes others work properly:
81285587Sobrien	!x+y is (!x)+y, and x!y is x !y, not two pattern-action statements.
81385587Sobrien	(These problems were pointed out by Bob Lenk of Posix.)
81485587Sobrien
81585587Sobrien	Added \x to regular expressions (already in strings).
81685587Sobrien	Limited octal to octal digits; \8 and \9 are not octal.
81785587Sobrien	Centralized the code for parsing escapes in regular expressions.
81885587Sobrien	Added a bunch of tests to T.re and T.sub to verify some of this.
81985587Sobrien
82085587SobrienFeb 9, 1990:
82185587Sobrien	fixed null pointer dereference bug in main.c:  -F[nothing].  sigh.
82285587Sobrien
82385587Sobrien	restored srand behavior:  it returns the current seed.
82485587Sobrien
82585587SobrienJan 18, 1990:
82685587Sobrien	srand now returns previous seed value (0 to start).
82785587Sobrien
82885587SobrienJan 5, 1990:
82985587Sobrien	fix potential problem in tran.c -- something was freed,
83085587Sobrien	then used in freesymtab.
83185587Sobrien
83285587SobrienOct 18, 1989:
83385587Sobrien	another try to get the max number of open files set with
83485587Sobrien	relatively machine-independent code.
83585587Sobrien
83685587Sobrien	small fix to input() in case of multiple reads after EOF.
83785587Sobrien
83885587SobrienOct 11, 1989:
83985587Sobrien	FILENAME is now defined in the BEGIN block -- too many old
84085587Sobrien	programs broke.
84185587Sobrien
84285587Sobrien	"-" means stdin in getline as well as on the commandline.
84385587Sobrien
84485587Sobrien	added a bunch of casts to the code to tell the truth about
84585587Sobrien	char * vs. unsigned char *, a right royal pain.  added a
84685587Sobrien	setlocale call to the front of main, though probably no one
84785587Sobrien	has it usefully implemented yet.
84885587Sobrien
84985587SobrienAug 24, 1989:
85085587Sobrien	removed redundant relational tests against nullnode if parse
85185587Sobrien	tree already had a relational at that point.
85285587Sobrien
85385587SobrienAug 11, 1989:
85485587Sobrien	fixed bug:  commandline variable assignment has to look like
85585587Sobrien	var=something.  (consider the man page for =, in file =.1)
85685587Sobrien
85785587Sobrien	changed number of arguments to functions to static arrays
85885587Sobrien	to avoid repeated malloc calls.
85985587Sobrien
86085587SobrienAug 2, 1989:
86185587Sobrien	restored -F (space) separator
86285587Sobrien
86385587SobrienJul 30, 1989:
86485587Sobrien	added -v x=1 y=2 ... for immediate commandline variable assignment;
86585587Sobrien	done before the BEGIN block for sure.  they have to precede the
86685587Sobrien	program if the program is on the commandline.
86785587Sobrien	Modified Aug 2 to require a separate -v for each assignment.
86885587Sobrien
86985587SobrienJul 10, 1989:
87085587Sobrien	fixed ref-thru-zero bug in environment code in tran.c
87185587Sobrien
87285587SobrienJun 23, 1989:
87385587Sobrien	add newline to usage message.
87485587Sobrien
87585587SobrienJun 14, 1989:
87685587Sobrien	added some missing ansi printf conversion letters: %i %X %E %G.
87785587Sobrien	no sensible meaning for h or L, so they may not do what one expects.
87885587Sobrien
87985587Sobrien	made %* conversions work.
88085587Sobrien
88185587Sobrien	changed x^y so that if n is a positive integer, it's done
88285587Sobrien	by explicit multiplication, thus achieving maximum accuracy.
88385587Sobrien	(this should be done by pow() but it seems not to be locally.)
88485587Sobrien	done to x ^= y as well.
88585587Sobrien
88685587SobrienJun 4, 1989:
88785587Sobrien	ENVIRON array contains environment: if shell variable V=thing,
88885587Sobrien		ENVIRON["V"] is "thing"
88985587Sobrien
89085587Sobrien	multiple -f arguments permitted.  error reporting is naive.
89185587Sobrien	(they were permitted before, but only the last was used.)
89285587Sobrien
89385587Sobrien	fixed a really stupid botch in the debugging macro dprintf
89485587Sobrien
89585587Sobrien	fixed order of evaluation of commandline assignments to match
89685587Sobrien	what the book claims:  an argument of the form x=e is evaluated
89785587Sobrien	at the time it would have been opened if it were a filename (p 63).
89885587Sobrien	this invalidates the suggested answer to ex 4-1 (p 195).
89985587Sobrien
90085587Sobrien	removed some code that permitted -F (space) fieldseparator,
90185587Sobrien	since it didn't quite work right anyway.  (restored aug 2)
90285587Sobrien
90385587SobrienApr 27, 1989:
90485587Sobrien	Line number now accumulated correctly for comment lines.
90585587Sobrien
90685587SobrienApr 26, 1989:
90785587Sobrien	Debugging output now includes a version date,
90885587Sobrien	if one compiles it into the source each time.
90985587Sobrien
91085587SobrienApr 9, 1989:
91185587Sobrien	Changed grammar to prohibit constants as 3rd arg of sub and gsub;
91285587Sobrien	prevents class of overwriting-a-constant errors.  (Last one?)
91385587Sobrien	This invalidates the "banana" example on page 43 of the book.
91485587Sobrien
91585587Sobrien	Added \a ("alert"), \v (vertical tab), \xhhh (hexadecimal),
91685587Sobrien	as in ANSI, for strings.  Rescinded the sloppiness that permitted
91785587Sobrien	non-octal digits in \ooo.  Warning:  not all compilers and libraries
91885587Sobrien	will be able to deal with \x correctly.
91985587Sobrien
92085587SobrienJan 9, 1989:
92185587Sobrien	Fixed bug that caused tempcell list to contain a duplicate.
92285587Sobrien	The fix is kludgy.
92385587Sobrien
92485587SobrienDec 17, 1988:
92585587Sobrien	Catches some more commandline errors in main.
92685587Sobrien	Removed redundant decl of modf in run.c (confuses some compilers).
92785587Sobrien	Warning:  there's no single declaration of malloc, etc., in awk.h
92885587Sobrien	that seems to satisfy all compilers.
92985587Sobrien
93085587SobrienDec 7, 1988:
93185587Sobrien	Added a bit of code to error printing to avoid printing nulls.
93285587Sobrien	(Not clear that it actually would.)
93385587Sobrien
93485587SobrienNov 27, 1988:
93585587Sobrien	With fear and trembling, modified the grammar to permit
93685587Sobrien	multiple pattern-action statements on one line without
93785587Sobrien	an explicit separator.  By definition, this capitulation
93885587Sobrien	to the ghost of ancient implementations remains undefined
93985587Sobrien	and thus subject to change without notice or apology.
94085587Sobrien	DO NOT COUNT ON IT.
94185587Sobrien
94285587SobrienOct 30, 1988:
94385587Sobrien	Fixed bug in call() that failed to recover storage.
94485587Sobrien
94585587Sobrien	A warning is now generated if there are more arguments
94685587Sobrien	in the call than in the definition (in lieu of fixing
94785587Sobrien	another storage leak).
94885587Sobrien
94985587SobrienOct 20, 1988:
95085587Sobrien	Fixed %c:  if expr is numeric, use numeric value;
95185587Sobrien	otherwise print 1st char of string value.  still
95285587Sobrien	doesn't work if the value is 0 -- won't print \0.
95385587Sobrien
95485587Sobrien	Added a few more checks for running out of malloc.
95585587Sobrien
95685587SobrienOct 12, 1988:
95785587Sobrien	Fixed bug in call() that freed local arrays twice.
95885587Sobrien
95985587Sobrien	Fixed to handle deletion of non-existent array right;
96085587Sobrien	complains about attempt to delete non-array element.
96185587Sobrien
96285587SobrienSep 30, 1988:
96385587Sobrien	Now guarantees to evaluate all arguments of built-in
96485587Sobrien	functions, as in C;  the appearance is that arguments
96585587Sobrien	are evaluated before the function is called.  Places
96685587Sobrien	affected are sub (gsub was ok), substr, printf, and
96785587Sobrien	all the built-in arithmetic functions in bltin().
96885587Sobrien	A warning is generated if a bltin() is called with
96985587Sobrien	the wrong number of arguments.
97085587Sobrien
97185587Sobrien	This requires changing makeprof on p167 of the book.
97285587Sobrien
97385587SobrienAug 23, 1988:
97485587Sobrien	setting FILENAME in BEGIN caused core dump, apparently
97585587Sobrien	because it was freeing space not allocated by malloc.
97685587Sobrien
97785587SobrienJuly 24, 1988:
97885587Sobrien	fixed egregious error in toupper/tolower functions.
97985587Sobrien	still subject to rescinding, however.
98085587Sobrien
98185587SobrienJuly 2, 1988:
98285587Sobrien	flush stdout before opening file or pipe
98385587Sobrien
98485587SobrienJuly 2, 1988:
98585587Sobrien	performance bug in b.c/cgoto(): not freeing some sets of states.
98685587Sobrien	partial fix only right now, and the number of states increased
98785587Sobrien	to make it less obvious.
98885587Sobrien
98985587SobrienJune 1, 1988:
99085587Sobrien	check error status on close
99185587Sobrien
99285587SobrienMay 28, 1988:
99385587Sobrien	srand returns seed value it's using.
99485587Sobrien	see 1/18/90
99585587Sobrien
99685587SobrienMay 22, 1988:
99785587Sobrien	Removed limit on depth of function calls.
99885587Sobrien
99985587SobrienMay 10, 1988:
100085587Sobrien	Fixed lib.c to permit _ in commandline variable names.
100185587Sobrien
100285587SobrienMar 25, 1988:
100385587Sobrien	main.c fixed to recognize -- as terminator of command-
100485587Sobrien	line options.  Illegal options flagged.
100585587Sobrien	Error reporting slightly cleaned up.
100685587Sobrien
100785587SobrienDec 2, 1987:
100885587Sobrien	Newer C compilers apply a strict scope rule to extern
100985587Sobrien	declarations within functions.  Two extern declarations in
101085587Sobrien	lib.c and tran.c have been moved to obviate this problem.
101185587Sobrien
101285587SobrienOct xx, 1987:
101385587Sobrien	Reluctantly added toupper and tolower functions.
101485587Sobrien	Subject to rescinding without notice.
101585587Sobrien
101685587SobrienSep 17, 1987:
101785587Sobrien	Error-message printer had printf(s) instead of
101885587Sobrien	printf("%s",s);  got core dumps when the message
101985587Sobrien	included a %.
102085587Sobrien
102185587SobrienSep 12, 1987:
102285587Sobrien	Very long printf strings caused core dump;
102385587Sobrien	fixed aprintf, asprintf, format to catch them.
102485587Sobrien	Can still get a core dump in printf itself.
102585587Sobrien
102685587Sobrien
1027