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

Re: [PATCH] http://svn.host.tld is valid URL [amended]

From: Alexy Khrabrov <alexy.khrabrov_at_setup.org>
Date: 2002-08-01 19:15:31 CEST

[Reposted with changes to the surrounding comments.]

* subversion/libsvn_subr/path.c
  (svn_path_is_url) assumed that URL has to have 3 slashes,
  which may not hold for top-level locations such as http://svn.host.tld
  which still should be able to be typed in without the trailing slash.

--
Problem description:
When hosting SVN at the top level, such as http://svn.host.tld,
you really want to give commands such as svn ls http://svn.host.tld
-- which previously failed immediately in the client as a URL was
supposed to have 3 slashes.  Two is enough, this validation is dumb
anyways.  The patch follows.  _Together_ with my previous patches, it
finally allows to host an SVN repository at the top level and operate
on it with the command line svn client.
Cheers,
Alexy
Index: subversion/libsvn_subr/path.c
===================================================================
--- subversion/libsvn_subr/path.c
+++ subversion/libsvn_subr/path.c	Thu Aug  1 13:00:18 2002
@@ -744,7 +744,7 @@
   /* ### This function is reaaaaaaaaaaaaaally stupid right now.
      We're just going to look for:
  
-        (scheme)://(optional_servername)/(optional_stuff)
+        (scheme)://(optional_stuff)
 
      Where (scheme) has no ':' or '/' characters.
 
@@ -752,7 +752,7 @@
   */
 
   /* Make sure we have enough characters to even compare. */
-  if (len < 5)
+  if (len < 4)
     return FALSE;
 
   /* Look for the sequence '://' */
@@ -771,11 +771,10 @@
       if (j == 0)
         return FALSE;
 
-      /* Expecting the next two chars to be '/', and somewhere
-         thereafter another '/'. */
+      /* Expecting the next two chars to be '/' */
+
       if ((path[j + 1] == '/')
-          && (path[j + 2] == '/')
-          && (strchr (path + j + 3, '/') != NULL))
+          && (path[j + 2] == '/'))
         return TRUE;
       
       return FALSE;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 1 19:18:06 2002

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.