Re: [dev] [st] [patch] multi-line selection causes core dump on OpenBSD

From: Maurice Quennet <mjq_AT_gmx.net>
Date: Mon, 23 Sep 2013 12:07:06 +0200

Roberto E. Vargas Caballero <k0ga_AT_shike2.com> wrote:
> If you agree with this small difference I will commit your change.

I don't mind.

Martti Kühne <mysatyre_AT_gmail.com> wrote:
> logically, wouldn't that be
>
> if(y < sel.ne.y && (x == 0 || !((gp-1)->mode & ATTR_WRAP)))
>
> ?
>
> I think the outcome for x==0 would be different in your suggestion.

Logically, it wouldn't be the same. In your case, "*ptr++ = '\n';" will
be executed, regardless whether !((gp-1)->mode & ATTR_WRAP)) holds true
or not (assuming x == 0).
Whereas in Roberto's case, the if condition never holds true for x == 0.
So as you mentioned, the outcome for x == 0 is different. It is to
decide which one is the correct behaviour.

As I my mentioned, a quick test of my fix (which should be logically
equivalent to Roberto's fix) showed no problems, but then again, it was
just a quick test.

Best regards
Maurice Quennet
Received on Mon Sep 23 2013 - 12:07:06 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 23 2013 - 12:12:06 CEST