From: Stefan Sperling Subject: Re: got diff chomps trailing \r To: Christian Weisgerber Cc: gameoftrees@openbsd.org Date: Thu, 11 May 2023 22:06:19 +0200 On Thu, May 11, 2023 at 09:46:18PM +0200, Christian Weisgerber wrote: > Stefan Sperling: > > > Thanks! Below patch makes your test pass. ok? > > What is the goal of treating \r\n as special here? > > Couldn't we just drop the special handling and treat \r as an > ordinary character? Ah, indeed. Yes, we could fix it like this. Ok by me if you would like to commit this fix and your test then. > > --- lib/diff_output.c > +++ lib/diff_output.c > @@ -90,13 +90,6 @@ diff_output_lines(struct diff_output_info *outinfo, FI > return rc; > if (ch == '\n') > len--; > - if (len) { > - rc = get_atom_byte(&ch, atom, len - 1); > - if (rc) > - return rc; > - if (ch == '\r') > - len--; > - } > } > > for (i = 0; i < len; i++) { > > -- > Christian "naddy" Weisgerber naddy@mips.inka.de > >