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

Re: patch solving <Location /> problem in mod_dav_svn/repos.c

From: Branko ÄŒibej <brane_at_xbc.nu>
Date: 2002-07-31 18:08:05 CEST

Alexy Khrabrov wrote:

>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. :-)
>

Thanks. Would you mind posting a log message in the correct format? It's
described in http://svn.collab.net/repos/svn/trunk/HACKING.

>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] == '/';
>

Urgh. I'd like to see everything right of the assignemnt enclosed in parens.
Also, is it absolutely, 100% certain that lenl can't be 0? If not,
that's a potential segfault right there,
and this test should be rewritten to:

    had_slash = (len1 > 0 && 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
>
>

-- 
Brane ÄŒibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
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:08:41 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.