X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgetopt.c;h=de30ec79fec56abda44edbe0882096361c076b7a;hb=5a79e1f048bd5ad328af146c6002baad87fd4f25;hp=57fd398ef9bbb4da8de46b4f830abf2169c641d6;hpb=cb0e9ba1b4f96efd5ca7649047d6aeb8edf01e6f;p=gnulib.git diff --git a/lib/getopt.c b/lib/getopt.c index 57fd398ef..de30ec79f 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -3,7 +3,7 @@ "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94 + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -383,7 +383,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) optarg = NULL; if (optind == 0) - optstring = _getopt_initialize (optstring); + { + optstring = _getopt_initialize (optstring); + optind = 1; /* Don't scan ARGV[0], the program name. */ + } if (nextchar == NULL || *nextchar == '\0') {