diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2025-11-18 13:20:40 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2025-11-18 18:53:24 +0000 |
| commit | abcb80f46c2607fc16564ca87cc25f0908f29f99 (patch) | |
| tree | b7c4a8765b4561a49475e6ca6826559d520d2397 | |
| parent | 7446569bbcb42c08c650a5e1015f544f13066d7f (diff) | |
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
| -rw-r--r-- | contrib/diff/src/diff3.c | 6 |
1 files 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. */ |
