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

Re: svn commit: rev 3014 - trunk/subversion/libsvn_subr

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-08-22 20:53:45 CEST

kfogel@tigris.org writes:

> Author: kfogel
> Date: 2002-08-22 13:29:21 -0500 (Thu, 22 Aug 2002)
> New Revision: 3014
>
> Modified:
> trunk/subversion/libsvn_subr/io.c
> Log:
> * subversion/libsvn_subr/io.c
> (svn_io_read_version_file): Close the file handle when done.
>
>
> Modified: trunk/subversion/libsvn_subr/io.c
> ==============================================================================
> --- trunk/subversion/libsvn_subr/io.c (original)
> +++ trunk/subversion/libsvn_subr/io.c Thu Aug 22 13:29:23 2002
> @@ -1888,12 +1888,17 @@
> apr_file_t *format_file;
> svn_stream_t *format_stream;
> svn_stringbuf_t *version_str;
> + apr_status_t apr_err;
>
> SVN_ERR (svn_io_file_open (&format_file, path, APR_READ,
> APR_OS_DEFAULT, pool));
> format_stream = svn_stream_from_aprfile (format_file, pool);
> SVN_ERR (svn_stream_readline (format_stream, &version_str, pool));

If there happens to be an empty file with that name version_str will
be NULL, which means this

> *version = atoi (version_str->data);

will dump core.

> + apr_err = apr_file_close (format_file);
> + if (apr_err)
> + return svn_error_createf (apr_err, 0, 0, pool,
> + "closing `%s'", format_file);

../svn/subversion/libsvn_subr/io.c: In function `svn_io_read_version_file':
../svn/subversion/libsvn_subr/io.c:1901: warning: char format, apr_file_t arg (arg 6)

> return SVN_NO_ERROR;
> }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 22 20:54:27 2002

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.