On Apr 11, 2004, at 12:05 PM, jpieper@tigris.org wrote:
> +/* Read a text representation of an apr_hash from STREAM into the hash
> + object HASH. Allocations are from POOL. This is copied directly
> + from svn_hash_read, with file reads replaced by stream reads. */
> +static svn_error_t *
> +hash_read (apr_hash_t *hash,
> + svn_stream_t *stream,
> + apr_pool_t *pool)
> +{
> + svn_error_t *err;
> + svn_stringbuf_t *stringbuf;
> + svn_boolean_t eof;
> + char buf[SVN_KEYLINE_MAXLEN];
> + apr_size_t num_read;
> + char c;
> + int first_time = 1;
> +
> +
> + while (1)
> + {
> + /* Read a key length line. Might be END, though. */
> + apr_size_t len = sizeof (buf);
> +
> + SVN_ERR (svn_stream_readline (stream, &stringbuf, "\n", &eof,
> pool));
> + if (eof)
> + {
> + /* We got an EOF on our very first attempt to read, which
> + means it's a zero-byte file. No problem, just go home.
> */
> + svn_error_clear (err);
> + return SVN_NO_ERROR;
Any specific reason for clearing the error here? As far as I can tell
if svn_stream_readline had returned an error you'd already have exited
the function, so err is probably uninitialized here...
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 11 19:21:56 2004