* Works fine under Debian GNU/Linux 7.4, NetBSD/amd64 6.99.36
* Merge pkgsrc specific changes
Changelog:
Dec 20, 2012:
fiddled makefile to get correct yacc and bison flags. pick yacc
(linux) or bison (mac) as necessary.
added __attribute__((__noreturn__)) to a couple of lines in
proto.h, to silence someone's enthusiastic checker.
fixed obscure call by value bug in split(a[1],a) reported on
9fans. the management of temporary values is just a mess; i
took a shortcut by making an extra string copy. thanks
to paul patience and arnold robbins for passing it on and for
proposed patches.
tiny fiddle in setfval to eliminate -0 results in T.expr, which
has irritated me for 20+ years.
Aug 10, 2011:
another fix to avoid core dump with delete(ARGV); again, many thanks
to ruslan ermilov.
Aug 7, 2011:
split(s, a, //) now behaves the same as split(s, a, "")
Jun 12, 2011:
/pat/, \n /pat/ {...} is now legal, though bad style to use.
added checks to new -v code that permits -vnospace; thanks to
ruslan ermilov for spotting this and providing the patch.
removed fixed limit on number of open files; thanks to aleksey
cheusov and christos zoulos.
fixed day 1 bug that resurrected deleted elements of ARGV when
used as filenames (in lib.c).
minor type fiddles to make gcc -Wall -pedantic happier (but not
totally so); turned on -fno-strict-aliasing in makefile.
May 6, 2011:
added #ifdef for isblank.
now allows -ffoo as well as -f foo arguments.
(thanks, ruslan)
May 1, 2011:
after advice from todd miller, kevin lo, ruslan ermilov,
and arnold robbins, changed srand() to return the previous
seed (which is 1 on the first call of srand). the seed is
an Awkfloat internally though converted to unsigned int to
pass to the library srand(). thanks, everyone.
fixed a subtle (and i hope low-probability) overflow error
in fldbld, by adding space for one extra \0. thanks to
robert bassett for spotting this one and providing a fix.
removed the files related to compilation on windows. i no
longer have anything like a current windows environment, so
i can't test any of it.
May 23, 2010:
fixed long-standing overflow bug in run.c; many thanks to
nelson beebe for spotting it and providing the fix.
fixed bug that didn't parse -vd=1 properly; thanks to santiago
vila for spotting it.
Feb 8, 2010:
i give up. replaced isblank with isspace in b.c; there are
no consistent header files.
Nov 26, 2009:
fixed a long-standing issue with when FS takes effect. a
change to FS is now noticed immediately for subsequent splits.
changed the name getline() to awkgetline() to avoid yet another
name conflict somewhere.
Feb 11, 2009:
temporarily for now defined HAS_ISBLANK, since that seems to
be the best way through the thicket. isblank arrived in C99,
but seems to be arriving at different systems at different
times.
Oct 8, 2008:
fixed typo in b.c that set tmpvec wrongly. no one had ever
run into the problem, apparently. thanks to alistair crooks.
Oct 23, 2007:
minor fix in lib.c: increase inputFS to 100, change malloc
for fields to n+1.
fixed memory fault caused by out of order test in setsval.
thanks to david o'brien, freebsd, for both fixes.
May 1, 2007:
fiddle in makefile to fix for BSD make; thanks to igor sobrado.
Mar 31, 2007:
fixed some null pointer refs calling adjbuf.
Feb 21, 2007:
fixed a bug in matching the null RE in sub and gsub. thanks to al aho
who actually did the fix (in b.c), and to wolfgang seeberg for finding
it and providing a very compact test case.
fixed quotation in b.c; thanks to Hal Pratt and the Princeton Dante
Project.
removed some no-effect asserts in run.c.
fiddled maketab.c to not complain about bison-generated values.
removed the obsolete -V argument; fixed --version to print the
version and exit.
fixed wording and an outright error in the usage message; thanks to igor
sobrado and jason mcintyre.
fixed a bug in -d that caused core dump if no program followed.
Jan 1, 2007:
dropped mac.code from makefile; there are few non-MacOSX
mac's these days.
Jan 17, 2006:
system() not flagged as unsafe in the unadvertised -safe option.
found it while enhancing tests before shipping the ;login: article.
practice what you preach.
removed the 9-years-obsolete -mr and -mf flags.
added -version and --version options.
core dump on linux with BEGIN {nextfile}, now fixed.
removed some #ifdef's in run.c and lex.c that appear to no
longer be necessary.
directly in pkgsrc/lang/nawk/files and adjusting the package Makefile
accordingly. The README.pkgsrc file includes notes on how the source
files were (minimally) adjusted.
Changes (for detailed list, see FIXES which is part of distribution):
* various bugfixes
* allow \n explicitly in character classes
* some 8bit cleanups
The checksum on the old package corresponded to the 19990620 source,
whilst the package thought it was 19980211. Fix package name accordingly.
Unfortunately, there is no version number or date on the awk distfile,
so put the distfile in its own uniquely-named directory.
Just for the record, there are a number of bug fixes in the 19990620
source:
Jun 20, 1999:
added *bp in gettok in lex.c; appears possible to exit function
without terminating the string. thanks to russ cox.
Jun 2, 1999:
added function stdinit() to run to initialize files[] array,
in case stdin, etc., are not constants; some compilers care.
May 10, 1999:
replaced the ERROR ... FATAL, etc., macros with functions
based on vprintf, to avoid problems caused by overrunning
fixed-size errbuf array. thanks to ralph corderoy for the
impetus, and for pointing out a string termination bug in
qstring as well.
Apr 21, 1999:
fixed bug that caused occasional core dumps with commandline
variable with value ending in \. (thanks to nelson beebe for
the test case.)
Apr 16, 1999:
with code kindly provided by Bruce Lilly, awk now parses
/=/ and similar constructs more sensibly in more places.
Apr 5, 1999:
changed true/false to True/False in run.c to make it
easier to compile with C++. Added some casts on malloc
and realloc to be honest about casts; ditto. changed
ltype int to long in struct rrow to reduce some 64-bit
complaints; other changes scattered throughout for the
same purpose. thanks to Nelson Beebe for these portability
improvements.
removed some horrible pointer-int casting in b.c and elsewhere
by adding ptoi and itonp to localize the casts, which are
all benign. fixed one incipient bug that showed up on sgi
in 64-bit mode.
reset lineno for new source file; include filename in error
message. also fixed line number error in continuation lines.
(thanks to Nelson Beebe for both of these.)
Mar 24, 1999:
Nelson Beebe notes that irix 5.3 yacc dies with a bogus
error; use a newer version or switch to bison, since sgi
is unlikely to fix it.
Mar 5, 1999:
changed isnumber to is_number to avoid the problem caused by
versions of ctype.h that include the name isnumber.
distribution now includes a script for building on a Mac,
thanks to Dan Allen.
Feb 20, 1999:
fixed memory leaks in run.c (call) and tran.c (setfval).
thanks to Stephen Nutt for finding these and providing the fixes.
Jan 13, 1999:
replaced srand argument by (unsigned int) in run.c;
avoids problem on Mac and potentially on Unix & Windows.
thanks to Dan Allen.
added a few (int) casts to silence useless compiler warnings.
e.g., errorflag= in run.c jump().
added proctab.c to the bundle outout; one less thing
to have to compile out of the box.
added calls to _popen and _pclose to the win95 stub for
pipes (thanks to Steve Adams for this helpful suggestion).
seems to work, though properties are not well understood
by me, and it appears that under some circumstances the
pipe output is truncated. Be careful.
Oct 19, 1998:
fixed a couple of bugs in getrec: could fail to update $0
after a getline var; because inputFS wasn't initialized,
could split $0 on every character, a misleading diversion.
fixed caching bug in makedfa: LRU was actually removing
least often used.
thanks to ross ridge for finding these, and for providing
great bug reports.