about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-02-13 18:28:59 +0000
committerMiles Bader <miles@gnu.org>1996-02-13 18:28:59 +0000
commite335fa388a21fbce18e5b19c6b5a4f3e5d25f762 (patch)
treef515c80743654289e1638227f92ee1f752891867
parentc6de69687174638ad7e94fca30b352521ba8bed8 (diff)
downloadglibc-e335fa388a21fbce18e5b19c6b5a4f3e5d25f762.tar.gz
glibc-e335fa388a21fbce18e5b19c6b5a4f3e5d25f762.tar.xz
glibc-e335fa388a21fbce18e5b19c6b5a4f3e5d25f762.zip
Updated from ../gpl2lgpl.sed /home/gd/gnu/lib/getopt.c
-rw-r--r--posix/getopt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/posix/getopt.c b/posix/getopt.c
index 4e11744db8..24da4d3aa9 100644
--- a/posix/getopt.c
+++ b/posix/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, 95
+   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
    	Free Software Foundation, Inc.
 
 This file is part of the GNU C Library.  Its master source is NOT part of
@@ -435,6 +435,13 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
     {
       /* Advance to the next ARGV-element.  */
 
+      /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+	 moved back by the user (who may also have changed the arguments).  */
+      if (last_nonopt > optind)
+	last_nonopt = optind;
+      if (first_nonopt > optind)
+	first_nonopt = optind;
+
       if (ordering == PERMUTE)
 	{
 	  /* If we have just processed some options following some non-options,