From e335fa388a21fbce18e5b19c6b5a4f3e5d25f762 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 13 Feb 1996 18:28:59 +0000 Subject: Updated from ../gpl2lgpl.sed /home/gd/gnu/lib/getopt.c --- posix/getopt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'posix/getopt.c') 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, -- cgit v1.2.3