From 0805c1add0e3fc951d16c27d3837bc5123842303 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 21 Dec 2016 17:41:59 +0100 Subject: Strip extraneous blank lines. --- scripts/find-blanks.awk | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 scripts/find-blanks.awk (limited to 'scripts') diff --git a/scripts/find-blanks.awk b/scripts/find-blanks.awk new file mode 100644 index 00000000..1d00609f --- /dev/null +++ b/scripts/find-blanks.awk @@ -0,0 +1,6 @@ +BEGIN { last_char = "x"; } +/^$/ { if (last_char == "{") print(FILENAME, FNR); last_char = " "; next; } +/^\s*{$/ { last_char = "{"; next; } +/ {$/ { last_char = "{"; next; } +/^\s*}$/ { if (last_char == " ") print(FILENAME, FNR); last_char = "}"; next; } + { last_char = "x"; } -- cgit v1.2.3