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

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: got diff chomps trailing \r
To:
gameoftrees@openbsd.org
Date:
Thu, 11 May 2023 21:46:18 +0200

Download raw body.

Thread
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?

--- 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