]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - posix/getopt.c
Mon Mar 27 02:23:15 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
[thirdparty/glibc.git] / posix / getopt.c
index 7fef53a0b308a6cf9b663cc0c984f4c0dc24d38e..85647e2d3657875161a0cb6b893f344945af4853 100644 (file)
@@ -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 file is part of the GNU C Library.  Its master source is NOT part of
@@ -387,7 +387,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')
     {