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

Re: [Patch] RE: Windows drive letter check fails on lower case current working drive

From: William A. Rowe Jr. <wrowe_at_rowe-clan.net>
Date: Wed, 20 Jan 2010 00:02:51 -0600

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
concern?;

+static int same_drive(const char *path1, const char *path2)
+{
+ if ((path1[0] < 'A' || (path1[0] > 'Z' && path1[0] < 'a') || path1[0] > 'Z')
+ || (path2[0] < 'A' || (path2[0] > 'Z' && path2[0] < 'a') || path2[0] > 'Z')
+ || path1[1] != ':' || path2[1] != ':')
+ return 0;

+ /* Once in the domain of ASCII alpha, compare these case insensitive */
+ return ((path1[0] & 0x1f) == (path2[0] & 0x1f));
+}
Received on 2010-01-20 07:03:41 CET

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