summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2011-09-01 22:33:54 +0200
committerJustin Davis <jrcd83@gmail.com>2011-09-01 22:33:54 +0200
commit1ec36ebc97a6c546d1ef0acc545d4636d36b89a1 (patch)
treef6757c70043d10fcbf2d9427c5836c996ecd0f3b /bin
parent2d34f8b70b39e985d562e8e08c9a7cc5bd732f8a (diff)
downloadgenpkg-1ec36ebc97a6c546d1ef0acc545d4636d36b89a1.tar.gz
genpkg-1ec36ebc97a6c546d1ef0acc545d4636d36b89a1.tar.xz
Ignore whitespace and add better error reporting for bad input.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pbjparse.awk8
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/pbjparse.awk b/bin/pbjparse.awk
index 8ba5372..be75811 100755
--- a/bin/pbjparse.awk
+++ b/bin/pbjparse.awk
@@ -83,15 +83,13 @@ function parsepbj ( cmd) # cmd is a "local" var
tcmd = joinfields(2)
templates[++templcount] = tcmd
}
- else if ($1 == "") ; # ignore blank lines
- else {
- print "ignoring line " FNR ": " $0 | "cat 1>&2"
- }
+ else if ($1 ~ /^[ \t]*$/) ; # ignore lines of whitespace
+ else die("invalid input: " $0)
}
function die (msg)
{
- printf "%s:%s.%d:%s\n", PROG, FILENAME, FNR, msg | "cat 1>&2"
+ printf "%s: error: %s:%d %s\n", PROG, FILENAME, FNR, msg | "cat 1>&2"
exit 1
}