[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Windows drive letter check fails on lower case cwd

From: William A. Rowe, Jr. <wrowe_at_rowe-clan.net>
Date: Sun, 08 Nov 2009 19:24:36 -0800

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 ;-)

:)

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415662
Received on 2009-11-09 04:24:56 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.