apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Windows drive letter check fails on lower case cwd
Date Mon, 09 Nov 2009 03:24:36 GMT
Bert Huijben wrote:
> 
> The drive letters don't have locales; the rest of the paths have. There are
> only 26 driveletters with the US-ASCII characters A-Z. (Internally always
> represented by the upper case letters, but the current path can use a lower
> case path, as that is only managed in userspace).

That's an odd statement; all paths are Unicode ;-)  We don't strcasecmp paths.

> I think a wrapper which maps 'a'-'z' explicitly might be a bit better, to
> resolve this specific issue.. 
> 
> Something like: (untested)
> 
> char drive_to_upper(char letter)
> {
>   if (letter >= 'a' && letter <= 'z')
>     return letter - 'a' + 'A';
>   else
>     return letter;
> }

A possibility, it seems reasonable.

> But the case this patch resolves an issue that has been reported only once
> over the last 9 years (at least for Subversion)... and the only place where
> this apr_toupper()would fail is when this specific case happens.. combined
> with this Turkish locale and the drive I:, which is very uncommon too...
> 
> Good theoretical bug ;-)

:)

Mime
View raw message