Skip to main content

svn_path_join

Function svn_path_join 

Source
pub unsafe extern "C" fn svn_path_join(
    base: *const c_char,
    component: *const c_char,
    pool: *mut apr_pool_t,
) -> *mut c_char
Expand description

Join a base path (@a base) with a component (@a component), allocating the result in @a pool. @a component need not be a single component: it can be any path, absolute or relative to @a base.

If either @a base or @a component is the empty path, then the other argument will be copied and returned. If both are the empty path the empty path is returned.

If the @a component is an absolute path, then it is copied and returned. Exactly one slash character (‘/’) is used to join the components, accounting for any trailing slash in @a base.

Note that the contents of @a base are not examined, so it is possible to use this function for constructing URLs, or for relative URLs or repository paths.

This function is NOT appropriate for native (local) file paths. Only for “internal” canonicalized paths, since it uses ‘/’ for the separator. Further, an absolute path (for @a component) is based on a leading ‘/’ character. Thus, an “absolute URI” for the @a component won’t be detected. An absolute URI can only be used for the base.

@deprecated Provided for backward compatibility with the 1.6 API. New code should use svn_dirent_join(), svn_relpath_join() or svn_fspath__join().