Skip to main content

svn_path_is_child

Function svn_path_is_child 

Source
pub unsafe extern "C" fn svn_path_is_child(
    path1: *const c_char,
    path2: *const c_char,
    pool: *mut apr_pool_t,
) -> *const c_char
Expand description

Test if @a path2 is a child of @a path1. If not, return @c NULL. If so, return a copy of the remainder path, allocated in @a pool. (The remainder is the component which, added to @a path1, yields @a path2. The remainder does not begin with a dir separator.)

Both paths must be in canonical form, and must either be absolute, or contain no “..” components.

If @a path2 is the same as @a path1, it is not considered a child, so the result is @c NULL; an empty string is never returned.

@note In 1.5 this function has been extended to allow a @c NULL @a pool in which case a pointer into @a path2 will be returned to identify the remainder path.

@deprecated Provided for backward compatibility with the 1.6 API. For replacement functionality, see svn_dirent_skip_ancestor(), svn_dirent_is_child(), svn_uri_skip_ancestor(), and svn_relpath_skip_ancestor().