From 95276f25769a0607cda50041169197d0522b98ff Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 2 Jul 2017 17:36:37 +1200 Subject: Lots of cleanup of awk scripts Mostly inspired by suggestions from gawk --lint --- bin/mi5.awk | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'bin/mi5.awk') diff --git a/bin/mi5.awk b/bin/mi5.awk index 48d71657..7acb6f3b 100644 --- a/bin/mi5.awk +++ b/bin/mi5.awk @@ -4,19 +4,14 @@ BEGIN { # You can change any of these, but while changing these is still relatively # sane... - if (!length(open)) - open = "<%" - if (!length(shut)) - shut = "%>" + open = "<%" + shut = "%>" # ... changing these probably isn't, and should compel you to rethink your # code, or quite possibly your entire life thus far. - if (!length(quote)) - quote = "`" - if (!length(unquote)) - unquote = "'" - if (!length(dnl)) - dnl = "dnl" + quote = "`" + unquote = "'" + dnl = "dnl" # We do not start in a block bmac = 0 @@ -24,7 +19,9 @@ BEGIN { # Fatal error function function fatal(str) { - printf "%s: %s\n", self, str | "cat >&2" + stderr = "cat >&2" + printf "%s: %s\n", self, str | stderr + close(stderr) exit(1) } -- cgit v1.2.3