Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 May 2011 16:50:59 GMT
From:      Pedro Giffuni <giffunip@tutopia.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/156888: Update lang/nawk to version 20110506
Message-ID:  <201105081650.p48GoxQN039790@red.freebsd.org>
Resent-Message-ID: <201105081700.p48H0G3j051606@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         156888
>Category:       ports
>Synopsis:       Update lang/nawk to version 20110506
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 08 17:00:16 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Pedro Giffuni
>Release:        8.2-Release
>Organization:
>Environment:
FreeBSD mogwai.giffuni.net 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Mar 18 15:35:09 UTC 2011     root@mogwai.giffuni.net:/usr/src/sys/amd64/compile/GENERIC  amd64

>Description:
Update to latest version:
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.


>How-To-Repeat:

>Fix:
Patch attached:

Patch attached with submission follows:

diff -ru nawk.orig/Makefile nawk/Makefile
--- nawk.orig/Makefile	2011-05-08 11:22:17.000000000 +0000
+++ nawk/Makefile	2011-05-08 11:23:26.000000000 +0000
@@ -7,7 +7,7 @@
 #
 
 PORTNAME=	nawk
-PORTVERSION=	20100523
+PORTVERSION=	20110506
 CATEGORIES=	lang
 MASTER_SITES=	http://www.cs.princeton.edu/~bwk/btl.mirror/
 DISTNAME=	awk
diff -ru nawk.orig/distinfo nawk/distinfo
--- nawk.orig/distinfo	2011-05-08 11:22:17.000000000 +0000
+++ nawk/distinfo	2011-05-08 11:23:32.000000000 +0000
@@ -1,2 +1,2 @@
-SHA256 (nawk/awk.tar.gz) = 0a533b796fc1be8606a2133e87b0f3965686e80f3606da0ae6e85a377a781e2d
-SIZE (nawk/awk.tar.gz) = 117839
+SHA256 (nawk/awk.tar.gz) = edc078a0d31efec7ccc477ddf47a676601e01ab6322664cec21702706a46b829
+SIZE (nawk/awk.tar.gz) = 106833
diff -ru nawk.orig/files/patch-main.c nawk/files/patch-main.c
--- nawk.orig/files/patch-main.c	2011-05-08 11:22:17.000000000 +0000
+++ nawk/files/patch-main.c	2011-05-08 11:26:26.000000000 +0000
@@ -1,5 +1,5 @@
---- main.c.orig	2007-05-01 16:05:28.000000000 -0500
-+++ main.c	2008-07-08 15:33:37.000000000 -0500
+--- main.c.orig	2011-05-06 12:27:59.000000000 +0000
++++ main.c	2011-05-08 11:25:32.000000000 +0000
 @@ -34,6 +34,8 @@
  #include "awk.h"
  #include "ytab.h"
@@ -9,11 +9,11 @@
  extern	char	**environ;
  extern	int	nfields;
  
-@@ -67,6 +69,7 @@
+@@ -68,6 +70,7 @@
  		exit(1);
  	}
  	signal(SIGFPE, fpecatch);
 +	feenableexcept(FE_DIVBYZERO|FE_INEXACT|FE_OVERFLOW);
- 	yyin = NULL;
- 	symtab = makesymtab(NSYMTAB/NSYMTAB);
- 	while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {
+ 
+ 	srand_seed = 1;
+ 	srand(srand_seed);
diff -ru nawk.orig/files/patch-run.c nawk/files/patch-run.c
--- nawk.orig/files/patch-run.c	2011-05-08 11:22:17.000000000 +0000
+++ nawk/files/patch-run.c	2011-05-08 11:36:06.000000000 +0000
@@ -1,6 +1,6 @@
---- run.c.orig	2009-11-26 23:59:16.000000000 +0000
-+++ run.c	2010-04-29 22:50:49.000000000 +0000
-@@ -1504,20 +1504,78 @@
+--- run.c.orig	2011-04-30 20:09:59.000000000 +0000
++++ run.c	2011-05-08 11:35:23.000000000 +0000
+@@ -1506,13 +1506,71 @@
  			nextarg = nextarg->nnext;
  		}
  		break;
@@ -74,11 +74,12 @@
  		break;
  	case FSRAND:
  		if (isrec(x))	/* no argument provided */
- 			u = time((time_t *)0);
+@@ -1520,7 +1578,7 @@
  		else
  			u = getfval(x);
+ 		tmp = u;
 -		srand((unsigned int) u);
 +		srandom((unsigned int) u);
+ 		u = srand_seed;
+ 		srand_seed = tmp;
  		break;
- 	case FTOUPPER:
- 	case FTOLOWER:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105081650.p48GoxQN039790>