On 11/12/2008 08:25 PM, [EMAIL PROTECTED] wrote:
> Author: covener
> Date: Wed Nov 12 11:25:03 2008
> New Revision: 713462
> 
> URL: http://svn.apache.org/viewvc?rev=713462&view=rev
> Log:
> change short-lived behavior of "DirectoryIndex None" based on feedback from 
> wrowe:
> 
> Doesn't search for anything:
>   DirectoryIndex disabled
> 
> Does search for literal "disabled":
>   DirectoryIndex disabled foo.
>   DirectoryIndex foo disabled 
>   DirectoryIndex disabled disabled 
> 
> Does search:
>   DirectoryIndex disabled.html
> 
> 
> Modified:
>     httpd/httpd/trunk/docs/manual/mod/mod_dir.html.en
>     httpd/httpd/trunk/docs/manual/mod/mod_dir.xml
>     httpd/httpd/trunk/docs/manual/mod/mod_dir.xml.meta
>     httpd/httpd/trunk/modules/mappers/mod_dir.c
> 

> Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_dir.c?rev=713462&r1=713461&r2=713462&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/mappers/mod_dir.c (original)
> +++ httpd/httpd/trunk/modules/mappers/mod_dir.c Wed Nov 12 11:25:03 2008
> @@ -47,13 +47,30 @@
>  static const char *add_index(cmd_parms *cmd, void *dummy, const char *arg)
>  {
>      dir_config_rec *d = dummy;
> -
> +    const char *t, *w;
> +    int count = 0;
> +   
>      if (!d->index_names) {
>          d->index_names = apr_array_make(cmd->pool, 2, sizeof(char *));
>      }
> -    if (strcasecmp(arg, "none")) { 
> -        *(const char **)apr_array_push(d->index_names) = arg;
> +
> +    t = arg;
> +    while ((w = ap_getword_conf(cmd->pool, &t)) && w[0]) { 
> +        if (count == 0 && !strcasecmp(w, "disabled")) { 
> +            /* peek to see if "disabled" is first in a series of arguments */
> +            const char *tt = t;
> +            fprintf(stderr, "t:'%s'\n", t);

I guess you forgot to remove this, correct?

> +            const char *ww = ap_getword_conf(cmd->pool, &tt);

Doesn't this mean that we lose the second argument if disabled is the first?
The second argument is stored in ww in this case and the the checking of the 
while
condition will let us advance to the third argument, correct?

> +            if (ww == NULL || !ww[0]) { 
> +               /* "disabled" is first, and alone */
> +                
> +               continue;

Why continue and not break? We already now that there is only one argument.
Where is the point in testing the while condition again?

> +            }
> +        }
> +        *(const char **)apr_array_push(d->index_names) = w;
> +        count++;
>      }
> +
>      return NULL;
>  }
>  

Regards

RĂ¼diger

Reply via email to