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
F150787980: D53808.diff
Sat, Apr 4, 1:40 AM
Unknown Object (File)
Thu, Apr 2, 6:15 AM
Unknown Object (File)
Wed, Apr 1, 11:20 AM
Unknown Object (File)
Fri, Mar 27, 8:44 AM
Unknown Object (File)
Thu, Mar 26, 3:40 AM
Unknown Object (File)
Wed, Mar 25, 12:06 AM
Unknown Object (File)
Fri, Mar 20, 2:16 PM
Unknown Object (File)
Wed, Mar 18, 7:26 PM
Subscribers

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

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