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

Re: svn commit: r1104124 - in /subversion/trunk/subversion: include/svn_io.h libsvn_subr/deprecated.c libsvn_subr/io.c

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 17 May 2011 07:12:58 -0400

On Tue, May 17, 2011 at 06:55, <danielsh_at_apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_subr/deprecated.c Tue May 17 10:55:51 2011
> @@ -630,6 +630,17 @@ svn_opt_print_generic_help(const char *h
>
>  /*** From io.c ***/
>  svn_error_t *
> +svn_io_file_create(const char *file,
> +                   const char *contents,
> +                   apr_pool_t *pool)
> +{
> +  const svn_string_t *contents_string;
> +
> +  contents_string = (contents ? svn_string_create(contents, pool) : NULL);
> +  return svn_io_file_create2(file, contents_string, pool);

contents_string can go on the stack, rather than allocated:

contents_string.data = contents;
contents_string.len = strlen(contents);
return svn_error_return(svn_io_file_create2(file, &contents_string, pool);

... tho it makes the NULL concept a bit more difficult.

>...

Cheers,
-g
Received on 2011-05-17 13:13:29 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.