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

Re: svn commit: r1079686 - /subversion/trunk/subversion/libsvn_diff/parse-diff.c

From: Senthil Kumaran S <stylesen_at_gmail.com>
Date: Fri, 18 Mar 2011 13:17:31 +0530

Hi Daniel,

On Tue, Mar 15, 2011 at 10:17 AM, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
>> Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=1079686&r1=1079685&r2=1079686&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
>> +++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Wed Mar  9 07:40:38 2011
>> @@ -287,18 +287,15 @@ scan_eol(const char **eol, apr_file_t *f
>>      {
>>        char buf[256];
>>        apr_size_t len;
>> -      svn_error_t *err;
>> +      svn_boolean_t eof = FALSE;
>>
>
> You don't need to initialize EOF.

Done.

> Also, you don't actually *read* that variable anywhere, so you should
> drop it entirely :-)

If I drop this variable and pass a NULL to the new API then I need to
handle "APR_STATUS_IS_EOF" with an 'if...else' as done before. I think
this is more simple and avoids conditional checks.

>>        if (total_len >= max_len)
>>          break;
>>
>>        len = sizeof(buf) - 1 < (max_len - total_len) ? sizeof(buf) - 1
>>                                                      : (max_len - total_len);
>> -      err = svn_io_file_read_full(file, buf, sizeof(buf) - 1, &len, pool);
>> -      if (err && APR_STATUS_IS_EOF(err->apr_err))
>> -        svn_error_clear(err);
>> -      else
>> -        SVN_ERR(err);
>> +      SVN_ERR(svn_io_file_read_full2(file, buf, sizeof(buf) - 1, &len, &eof,
>> +                                     pool));
>
> sizeof(buf)-1 or sizeof(buf)?  The next call passes sizeof(c) (which,
> there, is a char).

Yes agreed. Done the changes in r1082838.

Thank You.

-- 
Senthil Kumaran S
http://www.stylesen.org/
http://www.sasenthilkumaran.com/
Received on 2011-03-18 08:48:03 CET

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