summaryrefslogtreecommitdiff
path: root/usr.bin/m4/eval.c
diff options
context:
space:
mode:
authorBrian Callahan <bcallah@cvs.openbsd.org>2017-06-15 13:48:43 +0000
committerBrian Callahan <bcallah@cvs.openbsd.org>2017-06-15 13:48:43 +0000
commit091eeacaac7ad3be6504703535fa542aceb49f51 (patch)
treee66e1c29fa13f8ed26dfe45864c5d59f5c001ec6 /usr.bin/m4/eval.c
parentec91d0dcf7aee9849fae3c7da637679ff1069753 (diff)
Add -E flag (make warnings fatal), following the behavior of GNU m4 1.4.9+
Help and direction millert@ espie@ anton@ deraadt@ ok espie@
Diffstat (limited to 'usr.bin/m4/eval.c')
-rw-r--r--usr.bin/m4/eval.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c
index 18f2241a5db..0ce407b94e7 100644
--- a/usr.bin/m4/eval.c
+++ b/usr.bin/m4/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.74 2015/02/05 12:59:57 millert Exp $ */
+/* $OpenBSD: eval.c,v 1.75 2017/06/15 13:48:42 bcallah Exp $ */
/* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */
/*
@@ -269,6 +269,10 @@ expand_builtin(const char *argv[], int argc, int td)
warn("%s at line %lu: include(%s)",
CURRENT_NAME, CURRENT_LINE, argv[2]);
exit_code = 1;
+ if (fatal_warns) {
+ killdiv();
+ exit(exit_code);
+ }
} else
err(1, "%s at line %lu: include(%s)",
CURRENT_NAME, CURRENT_LINE, argv[2]);