Page MenuHomeFreeBSD

diff3: Use logical operations for booleans, not bitwise
ClosedPublic

Authored by emaste on Nov 18 2025, 5:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 17, 10:36 PM
Unknown Object (File)
Thu, Aug 13, 6:14 PM
Unknown Object (File)
Thu, Aug 13, 6:14 PM
Unknown Object (File)
Tue, Aug 11, 11:19 PM
Unknown Object (File)
Sun, Aug 9, 1:17 AM
Unknown Object (File)
Sat, Aug 8, 9:27 PM
Unknown Object (File)
Fri, Aug 7, 10:13 PM
Unknown Object (File)
Fri, Aug 7, 7:33 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.

Hmm, should also be && I guess.

incompat is actually an int that's incremented, so is not necessarily 0/1. explicitly compare != 0
leave bitwise & in place as that's what's still in the upstream GNU diff3

contrib/diff/src/diff3.c
304

This changes the semantics if incompat is neither 0 nor 1. Could have been a bug before, but could also be intentional.

I

contrib/diff/src/diff3.c
304

It was a bug; as the comment suggests any of the options AeExX3 without m should imply edscript. incompat is incremented for each of these options. Upstream has this fixed in a different way.

This revision is now accepted and ready to land.Nov 18 2025, 6:24 PM