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

(cherry picked from commit abcb80f46c)
This commit is contained in:
Ed Maste 2025-11-18 08:20:40 -05:00
parent 437c77476e
commit 56bdfd2d96

View file

@ -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. */