[PATCH 8/8] diff.c: rewrite emit_line_0 more understandably

2018-08-13 Thread Stefan Beller
Rewrite emit_line_0 to have fewer (nested) conditions. The change in 'emit_line' makes sure that 'first' is never user data, but always under our control, a sign or special character in the beginning of the line (or 0, in which case we ignore it). So from now on, let's pass only a diff marker or

Re: [PATCH 8/8] diff.c: rewrite emit_line_0 more understandably

2018-08-13 Thread Stefan Beller
On Mon, Aug 13, 2018 at 5:42 AM Johannes Schindelin wrote: > > Hi Stefan, > > On Fri, 10 Aug 2018, Stefan Beller wrote: > > > emit_line_0 has no nested conditions, but puts out all its arguments > > (if set) in order. > > Well, currently `emit_line_0()` *has* nested conditions: `first == '\n'` >

Re: [PATCH 8/8] diff.c: rewrite emit_line_0 more understandably

2018-08-13 Thread Johannes Schindelin
Hi Stefan, On Fri, 10 Aug 2018, Stefan Beller wrote: > emit_line_0 has no nested conditions, but puts out all its arguments > (if set) in order. Well, currently `emit_line_0()` *has* nested conditions: `first == '\n'` inside `len == 0`. And these nested conditions make things hard to read, so

[PATCH 8/8] diff.c: rewrite emit_line_0 more understandably

2018-08-10 Thread Stefan Beller
emit_line_0 has no nested conditions, but puts out all its arguments (if set) in order. There is still a slight confusion with set and set_sign, but let's defer that to a later patch. 'first' used be output always no matter if it was 0, but that got lost at "diff: add an internal option to

[PATCH 8/8] diff.c: rewrite emit_line_0 more understandably

2018-07-30 Thread Stefan Beller
emit_line_0 has no nested conditions, but puts out all its arguments (if set) in order. There is still a slight confusion with set and set_sign, but let's defer that to a later patch. 'first' used be output always no matter if it was 0, but that got lost at "diff: add an internal option to

Re: [PATCH 8/8] diff.c: rewrite emit_line_0 more understandably

2018-07-28 Thread Eric Sunshine
On Fri, Jul 27, 2018 at 11:05 PM Stefan Beller wrote: > emit_line_0 has no nested conditions, but puts out all its arguments > (if set) in order. There is still a slight confusion with set > and set_sign, but let's defer that to a later patch. > > 'first' used be output always no matter if it was

[PATCH 8/8] diff.c: rewrite emit_line_0 more understandably

2018-07-27 Thread Stefan Beller
emit_line_0 has no nested conditions, but puts out all its arguments (if set) in order. There is still a slight confusion with set and set_sign, but let's defer that to a later patch. 'first' used be output always no matter if it was 0, but that got lost got lost at e8c285c4f9c (diff: add an