You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/05/18 13:42:12 UTC
cvs commit: httpd-2.0/server main.c
trawick 01/05/18 04:42:12
Modified: . CHANGES
server main.c
Log:
Fix command-line processing so that if a bad argument is specified
Apache will exit.
Revision Changes Path
1.204 +3 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -r1.203 -r1.204
--- CHANGES 2001/05/18 00:48:56 1.203
+++ CHANGES 2001/05/18 11:42:06 1.204
@@ -1,5 +1,8 @@
Changes with Apache 2.0.18-dev
+ *) Fix command-line processing so that if a bad argument is specified
+ Apache will exit. [Jeff Trawick]
+
*) Change the make targets and rules to be consistent in all of the
Apache-owned source trees. [Roy Fielding]
1.98 +6 -2 httpd-2.0/server/main.c
Index: main.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/main.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- main.c 2001/04/04 07:15:33 1.97
+++ main.c 2001/05/18 11:42:10 1.98
@@ -294,6 +294,7 @@
apr_pool_t *ptemp; /* Pool for temporary config stuff, reset often */
apr_pool_t *pcommands; /* Pool for -D, -C and -c switches */
apr_getopt_t *opt;
+ apr_status_t rv;
module **mod;
const char *optarg;
@@ -324,7 +325,7 @@
*/
apr_getopt_init(&opt, pcommands, process->argc, process->argv);
- while (apr_getopt(opt, AP_SERVER_BASEARGS, &c, &optarg)
+ while ((rv = apr_getopt(opt, AP_SERVER_BASEARGS, &c, &optarg))
== APR_SUCCESS) {
char **new;
switch (c) {
@@ -362,10 +363,13 @@
case 't':
configtestonly = 1;
break;
- case '?':
case 'h':
usage(process);
}
+ }
+
+ if (rv != APR_EOF) { /* bad cmdline option */
+ usage(process);
}
apr_pool_create(&plog, pglobal);