Re: [Patch] RE: Windows drive letter check fails on lower case current working drive
William A. Rowe Jr. wrote:
> On 1/19/2010 5:19 AM, Bert Huijben wrote:
>> The patch was written on the 1.4.x branch but I svn switch'ed it to trunk for easy application.
> I would suggest one bit of alternate code that is a bit more condensed, any
> +static int same_drive(const char *path1, const char *path2)
> + if ((path1 < 'A' || (path1 > 'Z' && path1 < 'a') || path1 > 'Z')
> + || (path2 < 'A' || (path2 > 'Z' && path2 < 'a') || path2 > 'Z')
> + || path1 != ':' || path2 != ':')
> + return 0;
> + /* Once in the domain of ASCII alpha, compare these case insensitive */
> + return ((path1 & 0x1f) == (path2 & 0x1f));
Whatever you do, those last Z's should be z's or it all breaks.
Received on 2010-01-20 10:17:16 CET
This is an archived mail posted to the Subversion Dev