"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got diff chomps trailing \r
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 11 May 2023 22:06:19 +0200

Download raw body.

Thread
  • Omar Polo:

    got diff chomps trailing \r

  • 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
    > 
    > 
    
    
  • Omar Polo:

    got diff chomps trailing \r