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

Re: svn commit: r22410 - in trunk: . subversion/libsvn_client

From: David Glasser <glasser_at_mit.edu>
Date: 2006-11-28 05:25:45 CET

Right, I know I can do that, but I figured consistency with every
other use of that type was reasonable.

--dave

On 11/23/06, Daniel Rall <dlr@collab.net> wrote:
> Alternately, you could memset() a stack-allocated
> svn_client_commit_item2_t stucture to null out all of its field.
>
> On Wed, 22 Nov 2006, glasser@tigris.org wrote:
>
> > Author: glasser
> > Date: Wed Nov 22 21:15:43 2006
> > New Revision: 22410
> >
> > Log:
> > r21900 moved a pool-allocated svn_client_commit_item2_t to a stack
> > variable; however, this meant that the structure was not zeroed out
> > anymore, and so junk in the "path" field could cause the wrong line to
> > be printed in the log message fetcher. For consistency with every
> > other use of svn_client_commit_item2_t in the codebase, move it back
> > to the pool.
> >
> > * subversion/libsvn_client/prop_commands.c
> > (propset_on_url): Allocate an svn_client_commit_item2_t in the heap.
> >
> >
> > Modified:
> > trunk/ (props changed)
> > trunk/subversion/libsvn_client/prop_commands.c
> >
> > Modified: trunk/subversion/libsvn_client/prop_commands.c
> > URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/prop_commands.c?pathrev=22410&r1=22409&r2=22410
> > ==============================================================================
> > --- trunk/subversion/libsvn_client/prop_commands.c (original)
> > +++ trunk/subversion/libsvn_client/prop_commands.c Wed Nov 22 21:15:43 2006
> > @@ -247,14 +247,15 @@
> > /* Create a new commit item and add it to the array. */
> > if (ctx->log_msg_func || ctx->log_msg_func2)
> > {
> > - svn_client_commit_item2_t item;
> > + svn_client_commit_item2_t *item;
> > const char *tmp_file;
> > apr_array_header_t *commit_items
> > - = apr_array_make(pool, 1, sizeof(&item));
> > -
> > - item.url = target;
> > - item.state_flags = SVN_CLIENT_COMMIT_ITEM_PROP_MODS;
> > - APR_ARRAY_PUSH(commit_items, svn_client_commit_item2_t *) = &item;
> > + = apr_array_make(pool, 1, sizeof(item));
> > +
> > + item = apr_pcalloc(pool, sizeof(*item));
> > + item->url = target;
> > + item->state_flags = SVN_CLIENT_COMMIT_ITEM_PROP_MODS;
> > + APR_ARRAY_PUSH(commit_items, svn_client_commit_item2_t *) = item;
> > SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items,
> > ctx, pool));
> > if (! message)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: svn-help@subversion.tigris.org
>
>
>

-- 
David Glasser | glasser_at_mit.edu | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 28 05:26:42 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.