You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@qqmail.nl> on 2013/06/02 00:06:16 UTC

RE: svn commit: r1488538 - /subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c


> -----Original Message-----
> From: gbg@apache.org [mailto:gbg@apache.org]
> Sent: zaterdag 1 juni 2013 17:36
> To: commits@subversion.apache.org
> Subject: svn commit: r1488538 - /subversion/branches/invoke-diff-cmd-
> feature/subversion/libsvn_subr/io.c
> 
> Author: gbg
> Date: Sat Jun  1 15:36:07 2013
> New Revision: 1488538
> 
> URL: http://svn.apache.org/r1488538
> Log:
> On the invoke-diff-cmd branch:  Cast NULL to char*.
> 
> * subversion/libsvn_subr/io.c
> 
>   (svn_io_run_external_diff): Cast Null to char*.
> 
> 
> 
> Modified:
>     subversion/branches/invoke-diff-cmd-
> feature/subversion/libsvn_subr/io.c
> 
> Modified: subversion/branches/invoke-diff-cmd-
> feature/subversion/libsvn_subr/io.c
> URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-
> feature/subversion/libsvn_subr/io.c?rev=1488538&r1=1488537&r2=1488538
> &view=diff
> ==========================================================
> ====================
> --- subversion/branches/invoke-diff-cmd-
> feature/subversion/libsvn_subr/io.c (original)
> +++ subversion/branches/invoke-diff-cmd-
> feature/subversion/libsvn_subr/io.c Sat Jun  1 15:36:07 2013
> @@ -3035,8 +3035,8 @@ svn_io_run_external_diff(const char *dir
> 
>        for (i = 0; cmd[i]; ++i)
>          {
> -          failed_command = apr_pstrcat(pool, failed_command, cmd[i], NULL);
> -          failed_command = apr_pstrcat(pool, failed_command, " ", NULL);
> +          failed_command = apr_pstrcat(pool, failed_command, cmd[i], (char*)
> NULL);
> +          failed_command = apr_pstrcat(pool, failed_command, " ", (char*)
> NULL);

The apr_pstrcat() function allows a variable number of arguments so you can add cmd[i] and the " " at the same time. Using separate function calls would just double the amount of work and ram needed.

(This is just error condition code, so this amount is not that relevant... but it still cleans up the code)

	Bert

>          }
>        return svn_error_createf(SVN_ERR_EXTERNAL_PROGRAM, NULL,
>                                 _("'%s' was expanded to '%s' and returned %d"),
>