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

[PATCH] patch solving <Location /> problem

From: Alexy Khrabrov <alexy.khrabrov_at_setup.org>
Date: 2002-07-31 18:25:17 CEST

(Resent to follow the HACKING guidelines.)

Log message:

--
* repos.c
  (dav_svn_get_resource): do not remove the trailing slash for the root, /.
--
Problem description:
The problem was, you couldn't host SVN repository at the top level,
at http://svn.host.tld/, since the <Location /> was parsed incorrectly
in mod_dav_svn -- the trailing slash was misinterpreted as missing for
root, another / added, and / was redirected to //, which couldn't exist.
The problem existed for the / location only.
Greg Stein suggested the fix, which follows as a patch, 
tested and working.  :-)
Cheers,
Alexy
Index: subversion/mod_dav_svn/repos.c
===================================================================
--- subversion/mod_dav_svn/repos.c
+++ subversion/mod_dav_svn/repos.c	Wed Jul 31 11:34:31 2002
@@ -868,14 +868,10 @@
 
   /* make sure the URI does not have a trailing "/" */
   len1 = strlen(uri);
-  if (len1 > 1 && uri[len1 - 1] == '/')
-    {
-      had_slash = 1;
-      uri[len1 - 1] = '\0';
-    }
-  else
-    had_slash = 0;
-
+  had_slash = uri[len1 - 1] == '/';
+  if (len1 > 1 && had_slash)
+    uri[len1 - 1] = '\0';
+  
   comb->res.uri = uri;
 
   /* The URL space defined by the SVN provider is always a virtual
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 31 18:28:34 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.