diff options
author | 2004-01-07 18:16:42 +0000 | |
---|---|---|
committer | 2004-01-07 18:16:42 +0000 | |
commit | 0b1c43df9307f9832b932d565411d8b1cf635f5f (patch) | |
tree | 84381115256922e6f39caaba803f6299d7838010 /usr.bin/diff3/diff3prog.c | |
parent | Some code cleanup and fixes inspired by NetBSD changes from mycroft@ (diff) | |
download | wireguard-openbsd-0b1c43df9307f9832b932d565411d8b1cf635f5f.tar.xz wireguard-openbsd-0b1c43df9307f9832b932d565411d8b1cf635f5f.zip |
Correctly test for cases where one file is different, and the other has
no more changes.
ok millert@
Diffstat (limited to 'usr.bin/diff3/diff3prog.c')
-rw-r--r-- | usr.bin/diff3/diff3prog.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/diff3/diff3prog.c b/usr.bin/diff3/diff3prog.c index f0fb5c76d1a..c7a10e57346 100644 --- a/usr.bin/diff3/diff3prog.c +++ b/usr.bin/diff3/diff3prog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3prog.c,v 1.4 2003/11/09 20:13:57 otto Exp $ */ +/* $OpenBSD: diff3prog.c,v 1.5 2004/01/07 18:16:42 canacar Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -71,7 +71,7 @@ static const char copyright[] = #endif /* not lint */ #ifndef lint -static const char rcsid[] = "$OpenBSD: diff3prog.c,v 1.4 2003/11/09 20:13:57 otto Exp $"; +static const char rcsid[] = "$OpenBSD: diff3prog.c,v 1.5 2004/01/07 18:16:42 canacar Exp $"; #endif /* not lint */ #include <stdio.h> @@ -301,7 +301,7 @@ merge(int m1, int m2) d2->new.from,d2->new.to); } /* first file is different from others */ - if ((!t2 || t1) && d1->new.to < d2->new.from) { + if (!t2 || (t1 && d1->new.to < d2->new.from)) { /* stuff peculiar to 1st file */ if (eflag==0) { separate("1"); @@ -313,7 +313,7 @@ merge(int m1, int m2) continue; } /* second file is different from others */ - if ((!t1 || t2) && d2->new.to < d1->new.from) { + if (!t1 || (t2 && d2->new.to < d1->new.from)) { if (eflag==0) { separate("2"); keep(1, &d2->new); |