From e68edb8cf06a796453378b98d963692c838c400f Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sun, 19 Aug 2018 03:57:20 +0000 Subject: diff(1): Implement -B/--ignore-blank-lines As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag. This was not previously implemented here, so one was forced to create a link for GNU diff to /usr/local/bin/diff Implement the -B flag and add some primitive tests for it. It is implemented in the same fashion that -I is implemented; each chunk's lines are scanned, and if a non-blank line is encountered then the chunk will be output. Otherwise, it's skipped. MFC after: 2 weeks --- usr.bin/diff/diff.h | 1 + 1 file changed, 1 insertion(+) (limited to 'usr.bin/diff/diff.h') diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 87452058220f..1801587f9e68 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -67,6 +67,7 @@ #define D_EXPANDTABS 0x100 /* Expand tabs to spaces */ #define D_IGNOREBLANKS 0x200 /* Ignore white space changes */ #define D_STRIPCR 0x400 /* Strip trailing cr */ +#define D_SKIPBLANKLINES 0x800 /* Skip blank lines */ /* * Status values for print_status() and diffreg() return values -- cgit v1.2.3