summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2008-08-21 21:01:47 +0000
committerespie <espie@openbsd.org>2008-08-21 21:01:47 +0000
commit87a9001aa797245542ec8e3bc97e21282076afc0 (patch)
tree7dc2d2b33feb6d46e1070f21610eeb47a23cb27b /usr.bin/m4
parentextend format support to cater to recent GNU autoconf (diff)
downloadwireguard-openbsd-87a9001aa797245542ec8e3bc97e21282076afc0.tar.xz
wireguard-openbsd-87a9001aa797245542ec8e3bc97e21282076afc0.zip
in gnu-m4 mode, allow definition of the empty macro (yes, autoconf 2.62
actually uses this, bleh) okay otto@
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/eval.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c
index 258d3aae273..1968ad35413 100644
--- a/usr.bin/m4/eval.c
+++ b/usr.bin/m4/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.65 2008/08/16 12:25:21 espie Exp $ */
+/* $OpenBSD: eval.c,v 1.66 2008/08/21 21:01:47 espie Exp $ */
/* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */
/*
@@ -139,7 +139,7 @@ expand_builtin(const char *argv[], int argc, int td)
*/
ac = argc;
- if (argc == 3 && !*(argv[2]))
+ if (argc == 3 && !*(argv[2]) && !mimic_gnu)
argc--;
switch (td & TYPEMASK) {
@@ -576,9 +576,10 @@ expand_macro(const char *argv[], int argc)
void
dodefine(const char *name, const char *defn)
{
- if (!*name)
+ if (!*name && !mimic_gnu)
m4errx(1, "null definition.");
- macro_define(name, defn);
+ else
+ macro_define(name, defn);
}
/*
@@ -612,9 +613,10 @@ dodefn(const char *name)
static void
dopushdef(const char *name, const char *defn)
{
- if (!*name)
+ if (!*name && !mimic_gnu)
m4errx(1, "null definition.");
- macro_pushdef(name, defn);
+ else
+ macro_pushdef(name, defn);
}
/*