Subject: pkg/33499: net/ipw: patch to fix local variable conflict with global
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <gcw@primenet.com.au>
List: pkgsrc-bugs
Date: 05/17/2006 00:20:00
>Number:         33499
>Category:       pkg
>Synopsis:       net/ipw: patch to fix local variable conflict with global
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 17 00:20:00 +0000 2006
>Originator:     Geoff C. Wing
>Release:        NetBSD 3.99.19
>Organization:
>Environment:
System: NetBSD g.primenet.com.au 3.99.19 NetBSD 3.99.19 (G) #0: Mon May 15 16:08:36 EST 2006 gcw@g.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/G i386
Architecture: i386
Machine: i386
>Description:
	ipw uses a static variable with the same name as global version in
	<unistd.h>
	Patch to rename local var below.

>How-To-Repeat:
	build with gcc-4.*
>Fix:
Add as patch-ac:

$NetBSD: $

--- ipw.c.org	2006-05-17 10:06:30.000000000 +1000
+++ ipw.c	2006-05-17 10:08:09.000000000 +1000
@@ -257,7 +257,7 @@
 static int my_opterr = 1;	/* if error message should be printed */
 static int my_optind = 1;	/* index into parent argv vector */
 static int my_optopt;		/* character checked for validity */
-static int optreset;		/* reset getopt */
+static int my_optreset;		/* reset getopt */
 static char *my_optarg;		/* argument associated with option */
 
 #define	BADCH	(int)'?'
@@ -275,9 +275,9 @@
   static char *place = EMSG;	/* option letter processing */
   register char *oli = NULL;	/* option letter list index */
 
-  if (optreset || ! *place)
+  if (my_optreset || ! *place)
     {				/* update scanning pointer */
-      optreset = 0;
+      my_optreset = 0;
       if (my_optind >= nargc || *(place = nargv[my_optind]) != '-')
 	{
 	  place = EMSG;