The following reply was made to PR general/2714; it has been noted by GNATS.
From: "Ralf S. Engelschall" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: general/2714: Command line option '-?' doesn't work. Date: Mon, 27 Jul 1998 17:14:23 +0200 In article <[EMAIL PROTECTED]> you 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: > --- src/main/http_main.c.ORG Tue Jul 14 18:57:56 1998 > +++ src/main/http_main.c Mon Jul 27 17:25:28 1998 > @@ -4250,7 +4250,7 @@ > ap_setup_prelinked_modules(); > > while ((c = getopt(argc, argv, > - "D:C:c:Xd:f:vVhlL:St" > + "D:C:c:Xd:f:vVhlL:St?" > #ifdef DEBUG_SIGSTOP > "Z:" > #endif > @@ -5416,7 +5416,7 @@ > > ap_setup_prelinked_modules(); > > - while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVhlZ:iusSt")) != -1) { > + while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVhlZ:iusSt?")) != -1) { > char **new; > switch (c) { > case 'c': > @@ -5607,7 +5607,7 @@ > * but only handle the -L option > */ > llp_dir = SHARED_CORE_DIR; > - while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVhlL:SZ:t")) != -1) { > + while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVhlL:SZ:t?")) != -1) { > switch (c) { > case 'D': > case 'C': 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 document: Not -? should list the usage. Instead something like -h should be used. But because this is already used we usually first habe to rename it to -L and then provide a -h which does what is expected: Show a little help by giving the usage page. Ralf S. Engelschall [EMAIL PROTECTED] www.engelschall.com