bug-diffutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] bug#32249: [BUGFIX] cmp -b mangles result


From: mancha
Subject: [bug-diffutils] bug#32249: [BUGFIX] cmp -b mangles result
Date: Mon, 23 Jul 2018 06:48:26 +0000

Hi. count_newlines is passed the wrong buffer length (off-by-one) so it
overwrites first differing byte in first file's buffer. Attached patch
fixes.

Actual:

$ cmp -b <(echo bad) <(echo bug)
[snip] differ: byte 2, line 1 is  12 ^J 165 u


Expected:

$ cmp -b <(echo bad) <(echo bug)
[snip] differ: byte 2, line 1 is 141 a 165 u

Cheers!

--mancha

Attachment: cmp-newlines.patch
Description: Text document

Attachment: pgpZCWaTpRpLr.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]