Index: subversion/libsvn_fs_base/tree.c =================================================================== --- subversion/libsvn_fs_base/tree.c (revision 24706) +++ subversion/libsvn_fs_base/tree.c (working copy) @@ -635,52 +635,6 @@ } -/* Return a null-terminated copy of the first component of PATH, - allocated in POOL. If path is empty, or consists entirely of - slashes, return the empty string. - - If the component is followed by one or more slashes, we set *NEXT_P - to point after the slashes. If the component ends PATH, we set - *NEXT_P to zero. This means: - - If *NEXT_P is zero, then the component ends the PATH, and there - are no trailing slashes in the path. - - If *NEXT_P points at PATH's terminating null character, then - the component returned was the last, and PATH ends with one or more - slash characters. - - Otherwise, *NEXT_P points to the beginning of the next component - of PATH. You can pass this value to next_entry_name to extract - the next component. */ - -static char * -next_entry_name(const char **next_p, - const char *path, - apr_pool_t *pool) -{ - const char *end; - - /* Find the end of the current component. */ - end = strchr(path, '/'); - - if (! end) - { - /* The path contains only one component, with no trailing - slashes. */ - *next_p = 0; - return apr_pstrdup(pool, path); - } - else - { - /* There's a slash after the first component. Skip over an arbitrary - number of slashes to find the next one. */ - const char *next = end; - while (*next == '/') - next++; - *next_p = next; - return apr_pstrndup(pool, path, end - path); - } -} - - /* Flags for open_path. */ typedef enum open_path_flags_t { Index: subversion/libsvn_fs_util/fs-util.c =================================================================== --- subversion/libsvn_fs_util/fs-util.c (revision 24706) +++ subversion/libsvn_fs_util/fs-util.c (working copy) @@ -187,3 +187,33 @@ lock->path, lock->owner, fs->path); } +char * +next_entry_name(const char **next_p, + const char *path, + apr_pool_t *pool) +{ + const char *end; + + /* Find the end of the current component. */ + end = strchr(path, '/'); + + if (! end) + { + /* The path contains only one component, with no trailing + slashes. */ + *next_p = 0; + return apr_pstrdup(pool, path); + } + else + { + /* There's a slash after the first component. Skip over an arbitrary + number of slashes to find the next one. */ + const char *next = end; + while (*next == '/') + next++; + *next_p = next; + return apr_pstrndup(pool, path, end - path); + } +} + + Index: subversion/include/private/svn_fs_util.h =================================================================== --- subversion/include/private/svn_fs_util.h (revision 24706) +++ subversion/include/private/svn_fs_util.h (working copy) @@ -69,6 +69,27 @@ const char *username, const char *lock_owner); +/* Return a null-terminated copy of the first component of PATH, + allocated in POOL. If path is empty, or consists entirely of + slashes, return the empty string. + + If the component is followed by one or more slashes, we set *NEXT_P + to point after the slashes. If the component ends PATH, we set + *NEXT_P to zero. This means: + - If *NEXT_P is zero, then the component ends the PATH, and there + are no trailing slashes in the path. + - If *NEXT_P points at PATH's terminating null character, then + the component returned was the last, and PATH ends with one or more + slash characters. + - Otherwise, *NEXT_P points to the beginning of the next component + of PATH. You can pass this value to next_entry_name to extract + the next component. */ + +char * +next_entry_name(const char **next_p, + const char *path, + apr_pool_t *pool); + #ifdef __cplusplus } #endif /* __cplusplus */ Index: subversion/libsvn_fs_fs/tree.c =================================================================== --- subversion/libsvn_fs_fs/tree.c (revision 24706) +++ subversion/libsvn_fs_fs/tree.c (working copy) @@ -558,52 +558,6 @@ } -/* Return a null-terminated copy of the first component of PATH, - allocated in POOL. If path is empty, or consists entirely of - slashes, return the empty string. - - If the component is followed by one or more slashes, we set *NEXT_P - to point after the slashes. If the component ends PATH, we set - *NEXT_P to zero. This means: - - If *NEXT_P is zero, then the component ends the PATH, and there - are no trailing slashes in the path. - - If *NEXT_P points at PATH's terminating null character, then - the component returned was the last, and PATH ends with one or more - slash characters. - - Otherwise, *NEXT_P points to the beginning of the next component - of PATH. You can pass this value to next_entry_name to extract - the next component. */ - -static char * -next_entry_name(const char **next_p, - const char *path, - apr_pool_t *pool) -{ - const char *end; - - /* Find the end of the current component. */ - end = strchr(path, '/'); - - if (! end) - { - /* The path contains only one component, with no trailing - slashes. */ - *next_p = 0; - return apr_pstrdup(pool, path); - } - else - { - /* There's a slash after the first component. Skip over an arbitrary - number of slashes to find the next one. */ - const char *next = end; - while (*next == '/') - next++; - *next_p = next; - return apr_pstrndup(pool, path, end - path); - } -} - - /* Flags for open_path. */ typedef enum open_path_flags_t {