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, Apr 13, 10:59 AM
Unknown Object (File)
Sat, Apr 11, 9:19 PM
Unknown Object (File)
Sat, Apr 11, 3:06 PM
Unknown Object (File)
Fri, Apr 10, 6:48 AM
Unknown Object (File)
Wed, Apr 8, 8:44 AM
Unknown Object (File)
Tue, Apr 7, 12:16 PM
Unknown Object (File)
Sun, Apr 5, 12:51 PM
Unknown Object (File)
Sat, Apr 4, 1:40 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