You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexy Khrabrov <al...@setup.org> on 2002/08/01 17:15:31 UTC

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

[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

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

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Alexy Khrabrov <al...@setup.org> writes:
> * 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.

This is applied now, see revision 2900.

Meanwhile, Ben is testing your patch to subversion/mod_dav_svn/util.c,
dav_svn_build_uri(), so more on that later.

Thanks!

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org