Subject: misc/3697: getopt(3) mistakes/wording
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bgrayson@ece.utexas.edu>
List: netbsd-bugs
Date: 06/02/1997 05:14:08
>Number:         3697
>Category:       misc
>Synopsis:       Man page for getopt(3) has a bug and some poor wording.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun  2 03:20:03 1997
>Last-Modified:
>Originator:     Brian Grayson
>Organization:
	Parallel and Distributed Systems
	Electrical and Computer Engineering
	The University of Texas at Austin
>Release:        From sup of May 31
>Environment:
NetBSD marvin 1.2D NetBSD 1.2D (MARVIN) #30: Mon May  5 16:06:31 CDT 1997
bgrayson@marvin:/a/orac/home/orac/src/sys/arch/i386/compile/MARVIN i386

>Description:
	The man page for getopt(3) uses optarg when it means
	optstring, and has some slightly confused wording.
>How-To-Repeat:
>Fix:
  The patch below ends up printing "'?'. Setting" instead of
"'?'.  Setting" -- Am I doing something wrong with my placement
of the period so that it only puts one space after it instead of
two?

--- getopt.3    Mon Jun  2 04:55:15 1997
+++ getopt.3.fix        Mon Jun  2 05:01:08 1997
@@ -137,12 +137,12 @@
 If the
 .Fn getopt
 function encounters a character not found in the string
-.Va optarg
+.Va optstring
 or detects
-a missing option argument it writes an error message and returns
-.Ql ?
-to the
-.Em stderr .
+a missing option argument it writes an error message to 
+.Em stderr 
+and returns
+.Ql ? .
 Setting
 .Va opterr
 to a zero will disable these error messages.

>Audit-Trail:
>Unformatted: