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

Re: svn commit: r33588 - trunk/subversion/libsvn_subr

From: Lieven Govaerts <svnlgo_at_mobsol.be>
Date: Sun, 12 Oct 2008 22:08:58 +0200

Greg Stein wrote:
> File schemes should be possible on ANY platform, not just Windows.
> Please try to avoid windows-specific code -- make sure it *is*
> specific first.
>

Only on Windows we can have a drive letter in file urls, so only on
Windows we want to convert this drive letter to upper case.

> On Thu, Oct 9, 2008 at 3:09 PM, <lgo_at_tigris.org> wrote:
>> Author: lgo
>> Date: Thu Oct 9 15:09:40 2008
>> New Revision: 33588
>>
..
>> + /* Found a scheme, convert to lowercase and copy to dst. */
>> + src = (char*)path;
>> + while (*src != ':')
>> + *(dst++) = tolower((*src++));
>> + *(dst++) = ':';
>> + *(dst++) = '/';
>> + *(dst++) = '/';
>> + src += 3;
>> +#if defined(WIN32) || defined(__CYGWIN__)
>> + if (strncmp(canon, "file", 4) == 0)
>> + file_scheme = TRUE;
>> +#endif /* WIN32 or Cygwin */
>>
..
>> /* If this is an absolute path, then just copy over the initial
>> separator character. */
>> @@ -226,9 +247,9 @@ canonicalize(path_type_t type, const cha
>> #if defined(WIN32) || defined(__CYGWIN__)
>> /* If this is the first path segment of a file:// URI and it contains a
>> windows drive letter, convert the drive letter to upper case. */
>> - else if (url && canon_segments == 0 && seglen == 2 &&
>> - strcmp(host_uri.scheme, "file") == 0 &&
>> - src[0] >= 'a' && src[0] <= 'z' && src[1] == ':')
>> + else if (url && canon_segments == 1 && seglen == 2 &&
>> + file_scheme == TRUE &&
>> + src[0] >= 'a' && src[0] <= 'z' && src[1] == ':')
>> {

Lieven

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-10-12 22:08:22 CEST

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