[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH]: Fix issue 2218

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-02-15 01:35:29 CET

On Mon, 2005-02-14 at 18:05 -0600, kfogel@collab.net wrote:
> Daniel Berlin <dberlin@dberlin.org> writes:
> > Fix issue #2218
> >
> > * subversion/libsvn_client/delete.c (delete_urls): Use subpool
> > to verify target exists, and clear in between iterations.
>
> Looks good, just one question:
>
> > Index: subversion/libsvn_client/delete.c
> > ===================================================================
> > --- subversion/libsvn_client/delete.c (revision 13016)
> > +++ subversion/libsvn_client/delete.c (working copy)
> > @@ -124,6 +124,7 @@
> > svn_error_t *err;
> > const char *common;
> > int i;
> > + apr_pool_t *subpool = svn_pool_create (pool);
> >
> > /* Condense our list of deletion targets. */
> > SVN_ERR (svn_path_condense_targets (&common, &targets, paths, TRUE, pool));
> > @@ -170,16 +171,17 @@
> > for (i = 0; i < targets->nelts; i++)
> > {
> > const char *path = APR_ARRAY_IDX (targets, i, const char *);
> > + svn_pool_clear (subpool);
> > path = svn_path_uri_decode (path, pool);
> > APR_ARRAY_IDX (targets, i, const char *) = path;
> > SVN_ERR (svn_ra_check_path (ra_session, path, SVN_INVALID_REVNUM,
> > - &kind, pool));
> > + &kind, subpool));
> > if (kind == svn_node_none)
> > return svn_error_createf (SVN_ERR_FS_NOT_FOUND, NULL,
> > "URL '%s' does not exist",
> > svn_path_local_style (path, pool));
> > }
> > -
> > + svn_pool_destroy (subpool);
> > /* Fetch RA commit editor */
> > SVN_ERR (svn_client__commit_get_baton (&commit_baton, commit_info, pool));
> > SVN_ERR (svn_ra_get_commit_editor (ra_session, &editor, &edit_baton,
>
> Why not use the same subpool in the svn_path_uri_decode() call too?

Because of:
> APR_ARRAY_IDX (targets, i, const char *) = path;
We use targets array later on.
If you put the uri in the pool, then we clear the pool, and suddenly the
paths in the array are garbage :)

>
> -Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 15 01:36:57 2005

This is an archived mail posted to the Subversion Dev mailing list.