From: espie Date: Thu, 21 Aug 2008 21:01:47 +0000 (+0000) Subject: in gnu-m4 mode, allow definition of the empty macro (yes, autoconf 2.62 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=87a9001aa797245542ec8e3bc97e21282076afc0;p=openbsd in gnu-m4 mode, allow definition of the empty macro (yes, autoconf 2.62 actually uses this, bleh) okay otto@ --- 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); } /*