* lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset

is not set.
This commit is contained in:
Corinna Vinschen
2001-11-07 11:47:23 +00:00
parent d0e406c653
commit e2c07930f7
2 changed files with 6 additions and 1 deletions

View File

@ -214,7 +214,7 @@ getopt_internal(int nargc, char *const * nargv, const char *options)
* XXX re-initialize optind to 0 and have getopt_long(3)
* XXX properly function again. Work around this braindamage.
*/
if (optind == 0)
if (optind == 0 && optreset == 0)
optind = 1;
if (optreset)