Author: markj Date: Mon Jan 13 18:29:47 2020 New Revision: 356695 URL: https://svnweb.freebsd.org/changeset/base/356695
Log: Optimize diff -q. Once we know whether the files differ, we don't need to do any further work. PR: 242828 Submitted by: fehmi noyan isi <fnoyan...@yahoo.com> (original version) Reviewed by: bapt, kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23152 Modified: head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Mon Jan 13 18:26:27 2020 (r356694) +++ head/usr.bin/diff/diffreg.c Mon Jan 13 18:29:47 2020 (r356695) @@ -349,6 +349,11 @@ diffreg(char *file1, char *file2, int flags, int capsi goto closem; } + if (diff_format == D_BRIEF) { + rval = D_DIFFER; + status |= 1; + goto closem; + } if ((flags & D_FORCEASCII) == 0 && (!asciifile(f1) || !asciifile(f2))) { rval = D_BINARY; _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"