pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/nawk Update to 20121220



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e113acae2e3a
branches:  trunk
changeset: 631703:e113acae2e3a
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Wed Mar 12 14:20:43 2014 +0000

description:
Update to 20121220

* 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.

diffstat:

 lang/nawk/Makefile            |     7 +-
 lang/nawk/files/FIXES         |   140 +-
 lang/nawk/files/README        |     4 +-
 lang/nawk/files/README.pkgsrc |    10 +-
 lang/nawk/files/awk.h         |     4 +-
 lang/nawk/files/awkgram.y     |     8 +-
 lang/nawk/files/b.c           |    64 +-
 lang/nawk/files/lex.c         |    26 +-
 lang/nawk/files/lib.c         |    28 +-
 lang/nawk/files/main.c        |    65 +-
 lang/nawk/files/maketab.c     |     6 +-
 lang/nawk/files/missing95.c   |    14 -
 lang/nawk/files/proctab.c     |   202 +-
 lang/nawk/files/proto.h       |    12 +-
 lang/nawk/files/run.c         |   123 +-
 lang/nawk/files/tran.c        |    24 +-
 lang/nawk/files/ytab.c        |  4900 +++++++++++++---------------------------
 lang/nawk/files/ytab.h        |   332 +-
 18 files changed, 2176 insertions(+), 3793 deletions(-)

diffs (truncated from 6853 to 300 lines):

diff -r a4599d857cc7 -r e113acae2e3a lang/nawk/Makefile
--- a/lang/nawk/Makefile        Wed Mar 12 13:32:14 2014 +0000
+++ b/lang/nawk/Makefile        Wed Mar 12 14:20:43 2014 +0000
@@ -1,13 +1,12 @@
-# $NetBSD: Makefile,v 1.39 2012/10/02 20:11:46 asau Exp $
+# $NetBSD: Makefile,v 1.40 2014/03/12 14:20:43 ryoon Exp $
 
-DISTNAME=      nawk-20050424
-PKGREVISION=   3
+DISTNAME=      nawk-20121220
 CATEGORIES=    lang
 MASTER_SITES=  # empty
 DISTFILES=     # empty
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE=      http://cm.bell-labs.com/who/bwk/
+HOMEPAGE=      http://www.cs.princeton.edu/~bwk/btl.mirror/
 COMMENT=       Brian Kernighan's pattern-directed scanning and processing language
 
 PKG_INSTALLATION_TYPES=        overwrite pkgviews
diff -r a4599d857cc7 -r e113acae2e3a lang/nawk/files/FIXES
--- a/lang/nawk/files/FIXES     Wed Mar 12 13:32:14 2014 +0000
+++ b/lang/nawk/files/FIXES     Wed Mar 12 14:20:43 2014 +0000
@@ -1,4 +1,4 @@
-$NetBSD: FIXES,v 1.1 2006/07/14 14:23:06 jlam Exp $
+$NetBSD: FIXES,v 1.2 2014/03/12 14:20:43 ryoon Exp $
 
 /****************************************************************
 Copyright (C) Lucent Technologies 1997
@@ -27,6 +27,144 @@
 This file lists all bug fixes, changes, etc., made since the AWK book
 was sent to the printers in August, 1987.
 
+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.
+
 Apr 24, 2005:
        modified lib.c so that values of $0 et al are preserved in the END
        block, apparently as required by posix.  thanks to havard eidnes
diff -r a4599d857cc7 -r e113acae2e3a lang/nawk/files/README
--- a/lang/nawk/files/README    Wed Mar 12 13:32:14 2014 +0000
+++ b/lang/nawk/files/README    Wed Mar 12 14:20:43 2014 +0000
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.1 2006/07/14 14:23:06 jlam Exp $
+$NetBSD: README,v 1.2 2014/03/12 14:20:43 ryoon Exp $
 
 /****************************************************************
 Copyright (C) Lucent Technologies 1997
@@ -31,7 +31,7 @@
 Changes, mostly bug fixes and occasional enhancements, are listed
 in FIXES.  If you distribute this code further, please please please
 distribute FIXES with it.  If you find errors, please report them
-to bwk%bell-labs.com@localhost.  Thanks.
+to bwk%cs.princeton.edu@localhost.  Thanks.
 
 The program itself is created by
        make
diff -r a4599d857cc7 -r e113acae2e3a lang/nawk/files/README.pkgsrc
--- a/lang/nawk/files/README.pkgsrc     Wed Mar 12 13:32:14 2014 +0000
+++ b/lang/nawk/files/README.pkgsrc     Wed Mar 12 14:20:43 2014 +0000
@@ -1,4 +1,4 @@
-$NetBSD: README.pkgsrc,v 1.2 2009/10/29 20:21:53 tnn Exp $
+$NetBSD: README.pkgsrc,v 1.3 2014/03/12 14:20:43 ryoon Exp $
 
 The following changes were made to the standard distribution:
 
@@ -15,12 +15,4 @@
     * The *.bat files were removed.  These files are only used on
       MS Windows.
 
-    * The makefile.win file was removed.  This file is only used on
-      MS Windows.
-
-    * The mac.code files was removed.  This file is only used on
-      Mac OS with MPW.
-
     * A "NetBSD" CVS Id tag was added to each file.
-
-    * getline was renamed to get_line to avoid conflict with getline(3)
diff -r a4599d857cc7 -r e113acae2e3a lang/nawk/files/awk.h
--- a/lang/nawk/files/awk.h     Wed Mar 12 13:32:14 2014 +0000
+++ b/lang/nawk/files/awk.h     Wed Mar 12 14:20:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awk.h,v 1.2 2008/08/26 14:46:21 joerg Exp $ */
+/* $NetBSD: awk.h,v 1.3 2014/03/12 14:20:43 ryoon Exp $ */
 
 /****************************************************************
 Copyright (C) Lucent Technologies 1997
@@ -32,7 +32,7 @@
 
 typedef        unsigned char uschar;
 
-#define        xfree(a)        { if ((a) != NULL) { free((char *) a); a = NULL; } }
+#define        xfree(a)        { if ((a) != NULL) { free((void *) (a)); (a) = NULL; } }
 
 #define        NN(p)   ((p) ? (p) : "(null)")  /* guaranteed non-null for dprintf 
 */
diff -r a4599d857cc7 -r e113acae2e3a lang/nawk/files/awkgram.y
--- a/lang/nawk/files/awkgram.y Wed Mar 12 13:32:14 2014 +0000
+++ b/lang/nawk/files/awkgram.y Wed Mar 12 14:20:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awkgram.y,v 1.1 2006/07/14 14:23:06 jlam Exp $ */
+/* $NetBSD: awkgram.y,v 1.2 2014/03/12 14:20:43 ryoon Exp $ */
 
 /****************************************************************
 Copyright (C) Lucent Technologies 1997
@@ -52,7 +52,7 @@
 %token <i>     NL ',' '{' '(' '|' ';' '/' ')' '}' '[' ']'
 %token <i>     ARRAY
 %token <i>     MATCH NOTMATCH MATCHOP
-%token <i>     FINAL DOT ALL CCL NCCL CHAR OR STAR QUEST PLUS
+%token <i>     FINAL DOT ALL CCL NCCL CHAR OR STAR QUEST PLUS EMPTYRE
 %token <i>     AND BOR APPEND EQ GE GT LE LT NE IN
 %token <i>     ARG BLTIN BREAK CLOSE CONTINUE DELETE DO EXIT FOR FUNC 
 %token <i>     SUB GSUB IF INDEX LSUBSTR MATCHFCN NEXT NEXTFILE
@@ -176,8 +176,8 @@
 pa_stat:
          pa_pat                        { $$ = stat2(PASTAT, $1, stat2(PRINT, rectonode(), NIL)); }
        | pa_pat lbrace stmtlist '}'    { $$ = stat2(PASTAT, $1, $3); }
-       | pa_pat ',' pa_pat             { $$ = pa2stat($1, $3, stat2(PRINT, rectonode(), NIL)); }
-       | pa_pat ',' pa_pat lbrace stmtlist '}' { $$ = pa2stat($1, $3, $5); }
+       | pa_pat ',' opt_nl pa_pat              { $$ = pa2stat($1, $4, stat2(PRINT, rectonode(), NIL)); }
+       | pa_pat ',' opt_nl pa_pat lbrace stmtlist '}'  { $$ = pa2stat($1, $4, $6); }
        | lbrace stmtlist '}'           { $$ = stat2(PASTAT, NIL, $2); }
        | XBEGIN lbrace stmtlist '}'
                { beginloc = linkum(beginloc, $3); $$ = 0; }
diff -r a4599d857cc7 -r e113acae2e3a lang/nawk/files/b.c
--- a/lang/nawk/files/b.c       Wed Mar 12 13:32:14 2014 +0000
+++ b/lang/nawk/files/b.c       Wed Mar 12 14:20:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: b.c,v 1.2 2013/06/14 14:46:37 tron Exp $ */
+/* $NetBSD: b.c,v 1.3 2014/03/12 14:20:43 ryoon Exp $ */
 
 /****************************************************************
 Copyright (C) Lucent Technologies 1997
@@ -24,7 +24,7 @@
 THIS SOFTWARE.
 ****************************************************************/
 
-/* lasciate ogne speranza, voi ch'entrate. */
+/* lasciate ogne speranza, voi ch'intrate. */
 
 #define        DEBUG
 
@@ -46,10 +46,11 @@
 #define parent(v)      (v)->nnext
 
 #define LEAF   case CCL: case NCCL: case CHAR: case DOT: case FINAL: case ALL:
+#define ELEAF  case EMPTYRE:           /* empty string in regexp */
 #define UNARY  case STAR: case PLUS: case QUEST:
 
 /* encoding in tree Nodes:
-       leaf (CCL, NCCL, CHAR, DOT, FINAL, ALL):
+       leaf (CCL, NCCL, CHAR, DOT, FINAL, ALL, EMPTYRE):
                left is index, right contains value or pointer to value
        unary (STAR, PLUS, QUEST): left is child, right is null
        binary (CAT, OR): left and right are children
@@ -184,6 +185,7 @@
 void penter(Node *p)   /* set up parent pointers and leaf indices */
 {
        switch (type(p)) {
+       ELEAF
        LEAF
                info(p) = poscnt;
                poscnt++;



Home | Main Index | Thread Index | Old Index