diff --git a/lib/getopt_long.c b/lib/getopt_long.c index 19491fafb..e42782f27 100644 --- a/lib/getopt_long.c +++ b/lib/getopt_long.c @@ -91,11 +91,11 @@ main(argc, argv) int argc; char **argv; { - int c; - int digit_optind = 0; - while (1) { + int c; + int digit_optind = 0; + int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] =