httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: [PATCH] PR 3001- Win32: DocRoot x:/
Date Fri, 25 Sep 1998 17:44:25 GMT
Ken Parzygnat wrote:
> 
> Hi gang,
> 
> This is a Win32 patch to fix PR 3001.  The problem in 3001 is that you can't
> use 'x:/' as the DocumentRoot.  One of the main problems is in
> ap_os_canonical_filename in that 'x:/' was not being treated correctly.  The
> '/' was being stripped, then we'd call GetFullPathName which would take 'x:'
> and change it to the current path on x:, not the root of x:.  Also, we'd
> end up adding another slash to x:/ and leave the routine with a 'x://'.
> 
> I also hit http_core.c because core_translate takes the document root (x:/)
> and concatenates it with the URI (/foo) and you get 'x://foo' which isn't
> any good.  I thought this could be a problem on Unix, but I don't know if
> folks ever declare DocumentRoot as '/', therefore, I ifdef'd for WIN32
> only.

Why is this any different to the situtation where the root is "/" or
"x:/some/where/"?


> Let me know what you think!

> +        d = buf + strlen(buf);
> +        d--;

d=buf+strlen(buf)-1;

surely?

> +        while ((d >= buf) && (*d == '/') && nSlashes) {
> +          d--;
> +          nSlashes--;
> +        }
> +
> +        while (nSlashes--) {
> +            strcat(buf, "/");
> +        }

Not convinced about this bit. If you are trying to avoid one slash when
the path is "d:/" why not be more explicit about it?

> -    if (szPath[n - 1] == '\\' || szPath[n - 1] == '/') {
> +    if ((szPath[n - 1] == '\\' || szPath[n - 1] == '/') &&
> +        !((n == 3) && (szPath[1] == ':')))

I hate redundant brackets.

You asked :-)

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author     http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache/

WE'RE RECRUITING! http://www.aldigital.co.uk/

Mime
View raw message