NetBSD Problem Report #43981

From cheusov@tut.by  Sun Oct 17 20:17:22 2010
Return-Path: <cheusov@tut.by>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id B6E9B63B100
	for <gnats-bugs@gnats.netbsd.org>; Sun, 17 Oct 2010 20:17:21 +0000 (UTC)
Message-Id: <87pqv88th6.fsf@asrock.chizhovka.net>
Date: Sun, 17 Oct 2010 23:17:09 +0300
From: cheusov@tut.by
To: gnats-bugs@gnats.NetBSD.org
Subject: awk: too small limit on number -f options
X-Send-Pr-Version: 3.95

>Number:         43981
>Category:       bin
>Synopsis:       awk: too small limit on number -f options
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 17 20:20:01 +0000 2010
>Closed-Date:    Fri May 11 11:23:39 +0000 2012
>Last-Modified:  Fri May 11 11:23:39 +0000 2012
>Originator:     Aleksey Cheusov
>Release:        NetBSD 5.1_RC3
>Organization:
>Environment:
System: NetBSD asrock.chizhovka.net 5.1_RC3 NetBSD 5.1_RC3 (GENERIC) #1: Mon Jun 28 00:06:07 EEST 2010 cheusov@asrock.chizhovka.net:/srv/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
I extensively use AWK for programming under NetBSD and some of my programs pass
lots of -f arguments to awk interpreter. That is

   awk -f module1.awk -f module2.awk ... -f program

When a number of modules exceeds 20. AWK fails with exit status 2 and
the following message on stderr

   myprogram: too many -f options

Fix is below.

>How-To-Repeat:
awk -f 1.awk -f 2.awk ... -f 21.awk
>Fix:
Index: main.c
===================================================================
RCS file: /cvsroot/src/dist/nawk/main.c,v
retrieving revision 1.8
diff -u -r1.8 main.c
--- main.c	19 Oct 2008 19:33:47 -0000	1.8
+++ main.c	17 Oct 2010 20:15:11 -0000
@@ -50,7 +50,7 @@
 int	compile_time = 2;	/* for error printing: */
 				/* 2 = cmdline, 1 = compile, 0 = running */

-#define	MAX_PFILE	20	/* max number of -f's */
+#define	MAX_PFILE	200	/* max number of -f's */

 char	*pfile[MAX_PFILE];	/* program filenames from -f's */
 int	npfile = 0;	/* number of filenames */

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43981 CVS commit: src/external/historical/nawk/dist
Date: Sun, 17 Oct 2010 18:12:23 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Sun Oct 17 22:12:23 UTC 2010

 Modified Files:
 	src/external/historical/nawk/dist: main.c

 Log Message:
 PR/43981: Aleksey Cheusov: awk too small limit on number -f options
 remove the limit
 should we pullup to 5.x?


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/external/historical/nawk/dist/main.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Cheusov Aleksey <cheusov@tut.by>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: PR/43981 CVS commit: src/external/historical/nawk/dist
Date: Mon, 18 Oct 2010 13:34:24 +0300

 > =A0Modified Files:
 > =A0 =A0 =A0 =A0src/external/historical/nawk/dist: main.c
 >
 > =A0Log Message:
 > =A0PR/43981: Aleksey Cheusov: awk too small limit on number -f options
 > =A0remove the limit
 > =A0should we pullup to 5.x?

 Yes, please.

From: Cheusov Aleksey <cheusov@tut.by>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: PR/43981 CVS commit: src/external/historical/nawk/dist
Date: Mon, 18 Oct 2010 14:41:27 +0300

 > =A0To generate a diff of this commit:
 > =A0cvs rdiff -u -r1.2 -r1.3 src/external/historical/nawk/dist/main.c

 I think you can also remove MAX_PFILE define from the code.

State-Changed-From-To: open->closed
State-Changed-By: cheusov@NetBSD.org
State-Changed-When: Fri, 11 May 2012 11:23:39 +0000
State-Changed-Why:
Fixed in upcoming 6.0


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.