Resetting getopt

Rich Felker dalias at aerifal.cx
Fri Jul 7 12:34:26 UTC 2006


On Fri, Jul 07, 2006 at 09:45:39AM +0200, Peter S. Mazinger wrote:
> On Thu, 6 Jul 2006, Shaun Jackman wrote:
> 
> > There seems to be a bug in every applet -- mostly shells -- that
> > attempt to reset getopt. They all set `optind = 1;', but the getopt
> 
> from the glibc getopt.c:
> /* 1003.2 says this must be 1 before any call */
> int optind = 1;

This is expressing a requirement on the implementation, not a
requirement on the application.

Rich




More information about the busybox mailing list