diff options
author | 2004-06-18 07:23:50 +0000 | |
---|---|---|
committer | 2004-06-18 07:23:50 +0000 | |
commit | f02e3d868a55cf99e8681a219961f546974d2c4b (patch) | |
tree | 0b3edf1f2b000a4c5b2b9cad11440c5c7ff25900 /usr.bin/diff/diffreg.c | |
parent | Use -S for scp/sftp to force the use of the ssh being tested. ok djm@,markus@ (diff) | |
download | wireguard-openbsd-f02e3d868a55cf99e8681a219961f546974d2c4b.tar.xz wireguard-openbsd-f02e3d868a55cf99e8681a219961f546974d2c4b.zip |
If a new hunk immediately follows the previous one, merge them
into a single hunk. This makes diff produce the same diff as gdiff
in more cases. Found by brad@ and sturm@ using the ports tree.
ok millert@
Diffstat (limited to 'usr.bin/diff/diffreg.c')
-rw-r--r-- | usr.bin/diff/diffreg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index e2e60305f44..6c5b36ce3ae 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.55 2004/01/07 17:18:32 otto Exp $ */ +/* $OpenBSD: diffreg.c,v 1.56 2004/06/18 07:23:50 otto Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -65,7 +65,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.55 2004/01/07 17:18:32 otto Exp $"; +static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.56 2004/06/18 07:23:50 otto Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -1008,8 +1008,8 @@ restart: format == D_CONTEXT ? "---" : "+++", file2, ctime(&stb2.st_mtime)); anychange = 1; - } else if (a > context_vec_ptr->b + (2 * context) && - c > context_vec_ptr->d + (2 * context)) { + } else if (a > context_vec_ptr->b + (2 * context) + 1 && + c > context_vec_ptr->d + (2 * context) + 1) { /* * If this change is more than 'context' lines from the * previous change, dump the record and reset it. |