You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by plasma <pl...@pchome.com.tw> on 2004/01/15 06:40:54 UTC
bug report for svn_ra_dav__get_repos_root()
Hi all,
I was tracing a strange error in svk, and found get_repos_root()
returns an incorrect result if the target is a repo root.
I grep the source files, and only find blame use the call. The
following receipe requires a gdb:
gdb svn
break main
run blame http://svn.collab.net/repos/svn/
break blame.c:svn_client_blame
c
b 397 # [Note 1]
c
set variable kind = svn_node_file
b 408 # [Note 2]
c
(gdb) p reposURL
$1 = 0x8088518 "http://svn.collab.net/repos/sv"
[Note 1]: the line is 'if (kind == svn_node_dir)'.
[Note 2]: the next line of 'SVN_ERR (ra_lib->get_repos_root
(session, &reposURL, pool));'
My subversion is 0.36.0. Since I'm not good at C, I hope somebody
could fix this bug. :)
plasma
==========================================================
<<<�a�̦��_�_�������жi>>>
http://edm-prg.epaper.com.tw/click.php?ad_code=54833
==========================================================
PChome���~~���֤ѤѦ� \*^o^*//
http://love.pchome.com.tw/
==========================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] bug report for svn_ra_dav__get_repos_root()
Posted by John Szakmeister <jo...@szakmeister.net>.
On Thursday 15 January 2004 03:39, plasma wrote:
> On Thu, Jan 15, 2004 at 02:40:54PM +0800, plasma wrote:
> > I was tracing a strange error in svk, and found get_repos_root()
> > returns an incorrect result if the target is a repo root.
>
> I spent some time to trace the code, and found it's not too difficult
> for me. Below is the patch:
>
> --- subversion/libsvn_ra_dav/session.c.orig Thu Jan 15 14:59:04 2004
> +++ subversion/libsvn_ra_dav/session.c Thu Jan 15 14:59:48 2004
> @@ -777,7 +777,7 @@
> if (len <= relative_len)
> return svn_error_create(APR_EGENERAL, NULL,
> "Impossibly long relative url.");
> - len = len - relative_len - 1;
> + len = len - ( relative_len ? (relative_len + 1) : 0 );
> ras->repos_root = apr_pstrmemdup(ras->pool, ras->url, len);
> }
>
> My problem seems go away. I encounter another problem while running
> svk, but that's another story.
Committed a modified version of your patch in r8299. Thanks!
-John
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
[PATCH] bug report for svn_ra_dav__get_repos_root()
Posted by plasma <pl...@pchome.com.tw>.
On Thu, Jan 15, 2004 at 02:40:54PM +0800, plasma wrote:
> I was tracing a strange error in svk, and found get_repos_root()
> returns an incorrect result if the target is a repo root.
I spent some time to trace the code, and found it's not too difficult
for me. Below is the patch:
--- subversion/libsvn_ra_dav/session.c.orig Thu Jan 15 14:59:04 2004
+++ subversion/libsvn_ra_dav/session.c Thu Jan 15 14:59:48 2004
@@ -777,7 +777,7 @@
if (len <= relative_len)
return svn_error_create(APR_EGENERAL, NULL,
"Impossibly long relative url.");
- len = len - relative_len - 1;
+ len = len - ( relative_len ? (relative_len + 1) : 0 );
ras->repos_root = apr_pstrmemdup(ras->pool, ras->url, len);
}
My problem seems go away. I encounter another problem while running
svk, but that's another story.
plasma
==========================================================
<<<�a�̦��_�_�������жi>>>
http://edm-prg.epaper.com.tw/click.php?ad_code=54833
==========================================================
PChome���~~���֤ѤѦ� \*^o^*//
http://love.pchome.com.tw/
==========================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org