The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=abcb80f46c2607fc16564ca87cc25f0908f29f99
commit abcb80f46c2607fc16564ca87cc25f0908f29f99 Author: Ed Maste <[email protected]> AuthorDate: 2025-11-18 13:20:40 +0000 Commit: Ed Maste <[email protected]> CommitDate: 2025-11-18 18:53:24 +0000 diff3: Use logical-not, not bitwise for booleans And compare impcompat != 0 as it's actually an integer incremented on each use of one of the AeExX3 options. Reviewed by: fuz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53808 --- contrib/diff/src/diff3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/diff/src/diff3.c b/contrib/diff/src/diff3.c index c915d6b04c87..d0e8137756db 100644 --- a/contrib/diff/src/diff3.c +++ b/contrib/diff/src/diff3.c @@ -299,9 +299,9 @@ main (int argc, char **argv) } } - edscript = incompat & ~merge; /* -AeExX3 without -m implies ed script. */ - show_2nd |= ~incompat & merge; /* -m without -AeExX3 implies -A. */ - flagging |= ~incompat & merge; + edscript = (incompat != 0) & !merge; /* -AeExX3 without -m implies ed script. */ + show_2nd |= !incompat & merge; /* -m without -AeExX3 implies -A. */ + flagging |= !incompat & merge; if (incompat > 1 /* Ensure at most one of -AeExX3. */ || finalwrite & merge /* -i -m would rewrite input file. */
