On Sun, Feb 22, 2009 at 16:51, Bert Huijben <rhuijben_at_sharpsvn.net> wrote:
>...
> +++ trunk/subversion/libsvn_client/commit.c   Sun Feb 22 07:51:39 2009     (r36049)
>...
> @@ -1502,18 +1501,20 @@ svn_client_commit4(svn_commit_info_t **c
> Â Â Â Â Â Â Â Do nothing if target is already the base_dir. */
> Â Â Â Â Â if (strcmp(target, base_dir) != 0)
> Â Â Â Â Â Â {
> - Â Â Â Â Â Â Â svn_path_split(target, &parent_dir, &name, subpool);
> -
> + Â Â Â Â Â Â Â const char *parent_dir = svn_dirent_dirname(target, subpool);
> Â Â Â Â Â Â Â target = parent_dir;
Just assign target to the function result. Move parent_dir declaration
to the tighter block.
> Â Â Â Â Â Â Â while (strcmp(target, base_dir) != 0)
> Â Â Â Â Â Â Â Â {
> - Â Â Â Â Â Â Â Â Â SVN_ERR_ASSERT((target[0] != '\0') &&
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â !svn_dirent_is_root(target, strlen(target)));
> -
> Â Â Â Â Â Â Â Â Â APR_ARRAY_PUSH(dirs_to_lock,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const char *) = apr_pstrdup(pool, target);
> - Â Â Â Â Â Â Â Â Â target = svn_path_dirname(target, subpool);
> +
> + Â Â Â Â Â Â Â Â Â parent_dir = svn_dirent_dirname(target, subpool);
> +
> + Â Â Â Â Â Â Â Â Â if (strmcp(parent_dir, target) == 0)
> + Â Â Â Â Â Â Â Â Â Â break; /* Reached root directory */
> + Â Â Â Â Â Â Â Â Â else
> + Â Â Â Â Â Â Â Â Â Â target = parent_dir;
No need for the else.
Cheers,
-g
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1226598
Received on 2009-02-25 13:49:42 CET