--- helper.c.orig 2005-12-23 06:08:59.000000000 +0100 +++ helper.c 2005-12-28 10:51:29.000000000 +0100 @@ -39,7 +39,9 @@ extern char *optarg; extern int optind; +#ifdef HAVE_OPTRESET extern int optreset; +#endif #ifdef UNIX_COMPAT char* solaris_needs_strsep(char** str, char* delims) @@ -160,8 +162,14 @@ * now use getopt to look for our problem option */ #ifdef HAVE_GETOPT +#ifdef HAVE_OPTRESET optreset=1; +#endif +#ifdef __GLIBC__ + optind=0; +#else optind=1; +#endif /* * tell getopt to only be strict if the 'opts' is well defined */