The following reply was made to PR general/2714; it has been noted by GNATS.
From: "Ralf S. Engelschall" <[EMAIL PROTECTED]>
To: Maybe TABOO <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: Re: general/2714: Command line option '-?' doesn't work.
Date: Mon, 27 Jul 1998 19:02:41 +0200
On Tue, Jul 28, 1998, Maybe TABOO wrote:
> > >>Description:
> > > Command line option '-?' doesn't work. If you run with '-?' option,
> > > error message is printed.
> > >>How-To-Repeat:
> > > Run httpd with '-?' option.
> > >>Fix:
> > > Following patch is for 1.3.1:
> ...snip...
> > Ops, there is a bug, yes. But be careful. According to getopt(3)
> > on my FreeBSD box:
> >
> > | [..] The getopt() function returns -1 when the argument list is
> > exhausted,
> > | or `?' if a non-recognized option is encountered. [...]
> >
> > So, adding '?' is not correct, IMHO. Because then invalid options are no
> > longer catched. Instead the correct fix seems to be to change the httpd.8
>
> Getopt() returns '?' after it prints error message such as
> "progname: illegal option -- opt". So I think adding '?' is correct way.
>
> Check the file /usr/src/lib/libc/stdlib/getopt.c on your system.
Correct, but at least the error message is nasty. And the behavior that
getopt() really returns the "?" is not really portable I think, isn't it?
When one wants the usage list one doesn't expect an error ;-) I've now already
prepared a patch which tried to cleanup this option stuff. But nevertheless
thanks for your report and inital patch.
Ralf S. Engelschall
[EMAIL PROTECTED]
www.engelschall.com