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

Re: [PATCH] fix for programmer error in path split text logic

From: Martin Furter <mf_at_apache.org>
Date: Mon, 09 Dec 2013 21:33:19 +0530

Wrong button :/ Forwarding to the list too...

-------- Original Message --------
Subject: Re: [PATCH] fix for programmer error in path split text logic
Date: Mon, 09 Dec 2013 21:30:54 +0530
From: Martin Furter <mfurter_at_bluewin.ch>
To: Philip Martin <philip.martin_at_wandisco.com>

On 12/09/13 17:13, Philip Martin wrote:
> Martin Furter<mfurter_at_bluewin.ch> writes:
>
>> Index: subversion/libsvn_client/patch.c
>> ===================================================================
>> --- subversion/libsvn_client/patch.c (revision 1549528)
>> +++ subversion/libsvn_client/patch.c (working copy)
>> @@ -568,7 +568,7 @@
>> else if (*c == '\r')
>> {
>> *eol_str = "\r";
>> - if (*(c + 1) == '\n')
>> + if (c[1] == '\n')
>> {
>> *eol_str = "\r\n";
>> b->offset++;
>
> Take the case above, the surrounding code uses '*c' in many places so
> I'd argue that '*(c+1)' is consistent and that 'c[1]' is not an
> improvement.

I could also argue that it is inconsistent as long as you do not write
*c as *(c+0).

But this is irrelevant. As you found out the log message is wrong. So
here is a honest one:

[[[
What led to at least one bug will probably lead to more bugs so remove
the ugliness from the code to reduce the possibility of future bugs of
this kind.

...
]]]

;)

- Martin
Received on 2013-12-09 17:04:07 CET

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