Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jul 2017 17:36:04 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321076 - head/usr.bin/diff
Message-ID:  <201707171736.v6HHa403064986@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Jul 17 17:36:04 2017
New Revision: 321076
URL: https://svnweb.freebsd.org/changeset/base/321076

Log:
  Don't emit "diff: diff <options> arguments" when diffing files if
  -q is specified.
  
  This improves compatibility with GNU diff.
  
  Found by accident with `diff -Nrq /usr/tests /usr/tests.new | grep Kyuafile`.
  
  MFC after:	2 months
  Relnotes:	yes

Modified:
  head/usr.bin/diff/diffreg.c

Modified: head/usr.bin/diff/diffreg.c
==============================================================================
--- head/usr.bin/diff/diffreg.c	Mon Jul 17 16:59:22 2017	(r321075)
+++ head/usr.bin/diff/diffreg.c	Mon Jul 17 17:36:04 2017	(r321076)
@@ -1115,7 +1115,7 @@ restart:
 		return;
 	}
 proceed:
-	if (*pflags & D_HEADER) {
+	if (*pflags & D_HEADER && diff_format != D_BRIEF) {
 		diff_output("%s %s %s\n", diffargs, file1, file2);
 		*pflags &= ~D_HEADER;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707171736.v6HHa403064986>