Commit e8a5515d authored by Jeff Trawick's avatar Jeff Trawick
Browse files

Fix command-line processing so that if a bad argument is specified

Apache will exit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89150 13f79535-47bb-0310-9956-ffa450edef68
parent 68c91aae
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
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]
     
+6 −2
Original line number Diff line number Diff line
@@ -294,6 +294,7 @@ int main(int argc, const char * const argv[])
    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 @@ int main(int argc, const char * const argv[])
     */
    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,12 +363,15 @@ int main(int argc, const char * const argv[])
	case 't':
	    configtestonly = 1;
	    break;
	case '?':
	case 'h':
	    usage(process);
	}
    }

    if (rv != APR_EOF) { /* bad cmdline option */
        usage(process);
    }

    apr_pool_create(&plog, pglobal);
    apr_pool_create(&ptemp, pconf);