You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2006/05/11 00:22:08 UTC

Re: svn commit: r19571 - trunk/subversion/libsvn_client

On Tue, 2006-05-09 at 02:31 -0700, lundblad@tigris.org wrote:
> -  b->wcpath = eb->target ? apr_pstrdup(pool, eb->target) : "";
> +  b->wcpath = apr_pstrdup(pool, eb->target);

apr_pstrdup does not document that it accepts NULL as a second argument.
Although we do rely on that behavior in some places, I don't think we
ought to.

More importantly, apr_pstrdup returns NULL when its second argument is
NULL, which is different from the value "" used in the old code.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r19571 - trunk/subversion/libsvn_client

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
Greg Hudson writes:
 > On Tue, 2006-05-09 at 02:31 -0700, lundblad@tigris.org wrote:
 > > -  b->wcpath = eb->target ? apr_pstrdup(pool, eb->target) : "";
 > > +  b->wcpath = apr_pstrdup(pool, eb->target);
 > 
 > apr_pstrdup does not document that it accepts NULL as a second argument.
 > Although we do rely on that behavior in some places, I don't think we
 > ought to.

+1.

 > More importantly, apr_pstrdup returns NULL when its second argument is
 > NULL, which is different from the value "" used in the old code.
 > 

The point of this change is that eb->target may not be null, unless the
public APIs are misused.

Best,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org