httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: directory_walk bug?
Date Thu, 05 Feb 1998 19:48:20 GMT


On Thu, 5 Feb 1998, Ben Laurie wrote:

> Dean Gaudet wrote:
> > 
> > directory_walk looks like this:
> > 
> >     test_filename = pstrdup(r->pool, r->filename);
> > 
> >     if (!os_is_path_absolute(test_filename))
> >     {
> >         ...
> >     }
> > 
> >     r->filename   = os_canonical_filename(r->pool, r->filename);
> >     no2slash(test_filename);
> >     num_dirs = count_dirs(test_filename);
> > 
> >     ...
> > 
> > I believe that there's a bug.  I think that test_filename is
> > probably supposed to be a copy of the r->filename after
> > the os_canonical_filename.  test_filename is what's actually
> > used to do all the comparisons later on.
> 
> Hmmm... if only I could remember which way round it was before we move
> the os_canonical_filename. However, I'm inclined to agree.

Well we definately don't want the os_canonical_filename before that if
block, because that if block is for the proxy.  I just figure that
it should be something like:

    if (!os_is_path_absolute(r->filename))
    {
	test_filename = pstrdup(r->pool, r->filename);
	...
    }

    r->filename   = os_canonical_filename(r->pool, r->filename);
    test_filename = pstrdup(r->pool, r->filename);
    no2slash(test_filename);
    ...

Dean


Mime
View raw message