summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2008-08-21 21:01:48 +0000
committerMarc Espie <espie@cvs.openbsd.org>2008-08-21 21:01:48 +0000
commit250edc70bc8d65e93320f57d842e5ead13125dc3 (patch)
tree47f991854657817d1a7ef5a35060f0bc11f26ea7
parenta5cd275931f70b7325013321e283072d2a12ee69 (diff)
in gnu-m4 mode, allow definition of the empty macro (yes, autoconf 2.62
actually uses this, bleh) okay otto@
-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);
}
/*