FreeBSD/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c
/* Return in *LINK_TARGET_ABSPATH the absolute path the symlink at
 * LOCAL_ABSPATH is pointing to. Perform all allocations in POOL. */
Return in *LINK_TARGET_ABSPATH the absolute path the symlink at
LOCAL_ABSPATH is pointing to. Perform all allocations in POOL.
Return in * LINK_TARGET_ABSPATH the absolute path the symlink at LOCAL_ABSPATH is pointing to . Perform all allocations in POOL .
static svn_error_t *
read_link_target(const char **link_target_abspath,
                 const char *local_abspath,
                 apr_pool_t *pool)
{
  svn_string_t *link_target;
  const char *canon_link_target;
  SVN_ERR(svn_io_read_link(&link_target, local_abspath, pool));
  if (link_target->len == 0)
    return svn_error_createf(SVN_ERR_WC_NOT_SYMLINK, NULL,
                             _("The symlink at '%s' points nowhere"),
                             svn_dirent_local_style(local_abspath, pool));
  canon_link_target = svn_dirent_canonicalize(link_target->data, pool);
  if (!svn_dirent_is_absolute(canon_link_target))
    canon_link_target = svn_dirent_join(svn_dirent_dirname(local_abspath,
                                                           pool),
                                        canon_link_target, pool);
  if (svn_path_is_backpath_present(canon_link_target))
    SVN_ERR(svn_dirent_get_absolute(link_target_abspath, canon_link_target,
                                    pool));
  else
    *link_target_abspath = canon_link_target;
  return SVN_NO_ERROR;
}
static svn_error_t * read_link_target ( const char * * link_target_abspath , const char * local_abspath , apr_pool_t * pool ) { svn_string_t * link_target ; const char * canon_link_target ; SVN_ERR ( svn_io_read_link ( & link_target , local_abspath , pool ) ) ; if ( link_target -> len == 0 ) return svn_error_createf ( SVN_ERR_WC_NOT_SYMLINK , NULL , _ ( " " ) , svn_dirent_local_style ( local_abspath , pool ) ) ; canon_link_target = svn_dirent_canonicalize ( link_target -> data , pool ) ; if ( ! svn_dirent_is_absolute ( canon_link_target ) ) canon_link_target = svn_dirent_join ( svn_dirent_dirname ( local_abspath , pool ) , canon_link_target , pool ) ; if ( svn_path_is_backpath_present ( canon_link_target ) ) SVN_ERR ( svn_dirent_get_absolute ( link_target_abspath , canon_link_target , pool ) ) ; else * link_target_abspath = canon_link_target ; return SVN_NO_ERROR ; }
Return in *LINK_TARGET_ABSPATH the absolute path the symlink at
 LOCAL_ABSPATH is pointing to.
Return in * LINK_TARGET_ABSPATH the absolute path the symlink at LOCAL_ABSPATH is pointing to .
/* Treat relative symlinks as relative to LOCAL_ABSPATH's parent. */ /* Collapse any .. in the symlink part of the path. */