You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@locus.apache.org on 2000/08/09 16:57:00 UTC

cvs commit: apache-2.0/src/main http_main.c

wrowe       00/08/09 07:56:59

  Modified:    src/main http_main.c
  Log:
    Provide the first real-world update for the new apr_initopt/apr_getopt
    changes.
  
  Revision  Changes    Path
  1.64      +11 -8     apache-2.0/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- http_main.c	2000/08/06 06:07:34	1.63
  +++ http_main.c	2000/08/09 14:56:55	1.64
  @@ -276,7 +276,7 @@
   
   int main(int argc, char *argv[])
   {
  -    int c;
  +    char c;
       int configtestonly = 0;
       const char *confname = SERVER_CONFIG_FILE;
       const char *def_server_root = HTTPD_ROOT;
  @@ -287,8 +287,10 @@
       apr_pool_t *plog; /* Pool of log streams, reset _after_ each read of conf */
       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;
       module **mod;
       ap_directive_t *conftree = NULL;
  +    const char *optarg;
   
       apr_initialize();
       process = create_process(argc, (char *const *)argv);
  @@ -316,28 +318,29 @@
       /* Maintain AP_SERVER_BASEARGS list in http_main.h to allow the MPM 
        * to safely pass on our args from its rewrite_args() handler.
        */
  -    while (apr_getopt(process->argc, process->argv, 
  -                     AP_SERVER_BASEARGS, &c, pcommands) 
  +    apr_initopt(&opt, pcommands, process->argc, process->argv);
  +
  +    while (apr_getopt(opt, AP_SERVER_BASEARGS, &c, &optarg) 
               == APR_SUCCESS) {
           char **new;
           switch (c) {
    	case 'c':
   	    new = (char **)apr_push_array(ap_server_post_read_config);
  -	    *new = apr_pstrdup(pcommands, apr_optarg);
  +	    *new = apr_pstrdup(pcommands, optarg);
   	    break;
   	case 'C':
   	    new = (char **)apr_push_array(ap_server_pre_read_config);
  -	    *new = apr_pstrdup(pcommands, apr_optarg);
  +	    *new = apr_pstrdup(pcommands, optarg);
   	    break;
   	case 'd':
  -	    def_server_root = apr_optarg;
  +	    def_server_root = optarg;
   	    break;
   	case 'D':
   	    new = (char **)apr_push_array(ap_server_config_defines);
  -	    *new = apr_pstrdup(pcommands, apr_optarg);
  +	    *new = apr_pstrdup(pcommands, optarg);
   	    break;
   	case 'f':
  -	    confname = apr_optarg;
  +	    confname = optarg;
   	    break;
   	case 'v':
   	    printf("Server version: %s\n", ap_get_server_version());