summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-12-21 17:41:59 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-12-27 15:06:51 +0100
commit0805c1add0e3fc951d16c27d3837bc5123842303 (patch)
treebdce2e6e246f0f693552423c9b554092ce47a689 /scripts
parente22743070ff1f3d4cc83177c4669476fd2526844 (diff)
downloadmupdf-0805c1add0e3fc951d16c27d3837bc5123842303.tar.xz
Strip extraneous blank lines.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/find-blanks.awk6
1 files changed, 6 insertions, 0 deletions
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"; }