From 06b10d0e9a84e5ae88aede60a344c16bc28b852a Mon Sep 17 00:00:00 2001 From: millert <> Date: Sat, 26 Mar 2005 22:02:15 +0000 Subject: [PATCH] Document that historic BSD getopt(3) set optopt for each char, not just on error. --- src/lib/libc/stdlib/getopt.3 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3 index 831d35c0..e0dc3701 100644 --- a/src/lib/libc/stdlib/getopt.3 +++ b/src/lib/libc/stdlib/getopt.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: getopt.3,v 1.30 2004/12/22 16:24:53 jmc Exp $ +.\" $OpenBSD: getopt.3,v 1.31 2005/03/26 22:02:15 millert Exp $ .\" .Dd December 17, 2002 .Dt GETOPT 3 @@ -311,6 +311,19 @@ the .Ox .Fn getopt supports optional arguments separated by whitespace. +.Pp +Historic +.Bx +versions of +.Fn getopt +set +.Fa optopt +to the last option character processed. +However, this conflicts with +.St -p1003.1 +which stipulates that +.Fa optopt +be set to the last character that caused an error. .Sh HISTORY The .Fn getopt