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

Comment/code inconsistency: svn_path_get_absolute

From: Blair Zajac <blair_at_orcaware.com>
Date: 2007-07-24 08:37:58 CEST

The comment says the input path to svn_path_get_absolute() must be canonicalized:

/** Convert @a relative canonicalized path to an absolute path and
  * return the results in @a *pabsolute, allocated in @a pool.
  *
  * @a relative may be a URL, in which case no attempt is made to convert it,
  * and a copy of the URL is returned.
  */
svn_error_t *
svn_path_get_absolute(const char **pabsolute,
                       const char *relative,
                       apr_pool_t *pool);

But the first thing it does is to canonicalize it:

svn_error_t *
svn_path_get_absolute(const char **pabsolute,
                       const char *relative,
                       apr_pool_t *pool)
{
   char *buffer;
   apr_status_t apr_err;
   const char *path_apr;

   SVN_ERR(svn_path_cstring_from_utf8
           (&path_apr, svn_path_canonicalize(relative, pool), pool));

Seems safer to change the comment, but at the top of svn_path.h it says all
paths must be canonicalized, except for paths passed to svn_path_canonicalize()
and svn_path_internal_style()

Which should we change?

Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 24 08:37:02 2007

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.