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

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

From: Bert Huijben <bert_at_qqmail.nl>
Date: Sun, 2 Jun 2013 00:06:16 +0200

> -----Original Message-----
> From: gbg_at_apache.org [mailto:gbg_at_apache.org]
> Sent: zaterdag 1 juni 2013 17:36
> To: commits_at_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"),
>
Received on 2013-06-02 03:26:45 CEST

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