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

RE: [PATCH] fix for issue #2556: support working copies on the root of a (virtual) drive

From: Lieven Govaerts <lgo_at_mobsol.be>
Date: 2006-08-20 18:20:02 CEST

 

> -----Original Message-----
> From: Branko Èibej [mailto:brane@xbc.nu]
> Sent: zondag 20 augustus 2006 18:15
> To: Lieven Govaerts

> > I'm gonna stick to the svn_path_is_root function because of the
> > overhead needed to use apr_filepath_root.
> >
>
> I don't like the idea of rolling our own function for
> something that APR already does. The overhead is trivial when
> compared to the extra functionality *and portability* of
> apr_filepath_root. I think you need to prove that the
> overhead is unacceptable performance-wise.
>
I think you misunderstood me, the svn_path_is_root function is a wrapper
around apr_file_path_root. This is the current version (probably the one
that's going to be included in the patch):

svn_boolean_t
svn_path_is_root(const char *path, apr_pool_t *pool)
{
#if defined(WIN32)
  char *root_path = NULL;
  apr_pool_t *subpool = svn_pool_create(pool);
  char *rel_path = apr_pstrmemdup(subpool, path, strlen(path));

  apr_status_t status = apr_filepath_root(&root_path, &rel_path, 0,
subpool);

  apr_pool_destroy(subpool);

  if ((status == APR_SUCCESS ||
       status == APR_EINCOMPLETE) &&
      rel_path[0] == 0)
    return TRUE;

  return FALSE;
#endif /* WIN32 */
 
  return path[0] == '/' && path[1] == 0;
}

Lieven.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Aug 20 18:21:37 2006

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.