diff options
author | Can Erkin Acar <canacar@cvs.openbsd.org> | 2004-01-07 18:16:43 +0000 |
---|---|---|
committer | Can Erkin Acar <canacar@cvs.openbsd.org> | 2004-01-07 18:16:43 +0000 |
commit | 9c57253ff50fe7b9845996ced49a56d2ff779d18 (patch) | |
tree | ca25566abe3e54d6256ee0a981e7bcd3d93650bb /usr.bin/diff3 | |
parent | f2b2bfcdb832835ebd6437d16ca7d074e6fe12f8 (diff) |
Correctly test for cases where one file is different, and the other has
no more changes.
ok millert@
Diffstat (limited to 'usr.bin/diff3')
-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); |