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

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

From: Stefan Kueng <tortoisesvn_at_gmail.com>
Date: Wed, 07 Jan 2009 18:18:14 +0100

Julian Foad wrote:
> On Mon, 2008-12-29 at 09:09 -0800, Stefan Kueng wrote:
>> Author: steveking
>> Date: Mon Dec 29 09:09:17 2008
>> New Revision: 34963
>>
>> Log:
>> Fix bug in svn_path_is_canonical() where Windows UNC paths were always
>> considered non-canonical.
>>
>> * subversion/libsvn_subr/dirent_uri.c
>> (svn_uri_is_canonical): skip the second '/' of an UNC path.
>>
>> Modified:
>> trunk/subversion/libsvn_subr/dirent_uri.c
>>
>> Modified: trunk/subversion/libsvn_subr/dirent_uri.c
>> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_subr/dirent_uri.c?pathrev=34963&r1=34962&r2=34963
>> ==============================================================================
>> --- trunk/subversion/libsvn_subr/dirent_uri.c Sun Dec 28 12:03:46 2008 (r34962)
>> +++ trunk/subversion/libsvn_subr/dirent_uri.c Mon Dec 29 09:09:17 2008 (r34963)
>> @@ -1140,6 +1140,9 @@ svn_uri_is_canonical(const char *uri)
>> ! (*(ptr+1) >= 'A' && *(ptr+1) <= 'Z') &&
>> *(ptr+2) == ':')
>> return FALSE;
>> + /* if this is an UNC path, we have two '/' here */
>> + if (*(ptr+1) == '/')
>> + ptr++;
>> }
>> #endif /* WIN32 or Cygwin */
>
> This allows an extra slash in that position for all URIs when running on
> Windows. Shouldn't this extra check be conditional on "if (strncmp(uri,
> "file:", 5) == 0"?

But then plain UNC paths wouldn't work, e.g. //servername/folder/file

Maybe the svn_path_is_canonical() should differ between paths and urls?

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1010169

Received on 2009-01-07 18:24:12 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.