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

Re: svn commit: r31673 - trunk/subversion/libsvn_repos

From: David Glasser <glasser_at_davidglasser.net>
Date: Wed, 11 Jun 2008 13:12:29 -0700

On Tue, Jun 10, 2008 at 4:02 AM, <stsp_at_tigris.org> wrote:
> Author: stsp
> Date: Tue Jun 10 04:02:48 2008
> New Revision: 31673
>
> Log:
> * subversion/libsvn_repos/hooks.c
> (svn_repos__hooks_start_commit): Fix a compiler warning, 'assignment
> discards qualifiers from pointer target type'.
>
> Patch by: stylesen
> kameshj
>
> Modified:
> trunk/subversion/libsvn_repos/hooks.c
>
> Modified: trunk/subversion/libsvn_repos/hooks.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_repos/hooks.c?pathrev=31673&r1=31672&r2=31673
> ==============================================================================
> --- trunk/subversion/libsvn_repos/hooks.c Mon Jun 9 23:30:19 2008 (r31672)
> +++ trunk/subversion/libsvn_repos/hooks.c Tue Jun 10 04:02:48 2008 (r31673)
> @@ -576,7 +576,7 @@ svn_repos__hooks_start_commit(svn_repos_
> }
> else
> {
> - capabilities_string = "";
> + capabilities_string = apr_pstrdup(pool, "");
> }

I'm pretty late here, but why not something like:

Index: subversion/libsvn_repos/hooks.c
===================================================================
--- subversion/libsvn_repos/hooks.c (revision 31705)
+++ subversion/libsvn_repos/hooks.c (working copy)
@@ -564,19 +564,21 @@
   else if (hook)
     {
       const char *args[5];
- char *capabilities_string;
+ const char *capabilities_string;

       if (capabilities)
         {
- capabilities_string = svn_cstring_join(capabilities, ":", pool);
+ char *capabilities_buf = svn_cstring_join(capabilities, ":", pool);

           /* Get rid of that annoying final colon. */
- if (capabilities_string[0])
- capabilities_string[strlen(capabilities_string) - 1] = '\0';
+ if (capabilities_buf[0])
+ capabilities_buf[strlen(capabilities_buf) - 1] = '\0';
+
+ capabilities_string = capabilities_buf;
         }
       else
         {
- capabilities_string = apr_pstrdup(pool, "");
+ capabilities_string = "";
         }

       args[0] = hook;

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-11 22:13:17 CEST

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.