summaryrefslogtreecommitdiff
path: root/usr.bin/m4
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2001-09-18 14:17:39 +0000
committerMarc Espie <espie@cvs.openbsd.org>2001-09-18 14:17:39 +0000
commit5efa71bdbc1a1a5b3f6f82657881c68933a7dd0b (patch)
tree029d93e21d75d85efb54fb91739e8bb9e4f90e22 /usr.bin/m4
parentec33d1ee12fb1fdd1be4228da2cb286c379a5a21 (diff)
better gnu m4 emulation for dumpdef
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/eval.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c
index 32f76ea58c3..4e367003c0b 100644
--- a/usr.bin/m4/eval.c
+++ b/usr.bin/m4/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.32 2001/09/18 14:10:55 espie Exp $ */
+/* $OpenBSD: eval.c,v 1.33 2001/09/18 14:17:38 espie Exp $ */
/* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95";
#else
-static char rcsid[] = "$OpenBSD: eval.c,v 1.32 2001/09/18 14:10:55 espie Exp $";
+static char rcsid[] = "$OpenBSD: eval.c,v 1.33 2001/09/18 14:17:38 espie Exp $";
#endif
#endif /* not lint */
@@ -628,7 +628,19 @@ static void
dump_one_def(p)
ndptr p;
{
- fprintf(stderr, "`%s'\t`%s'\n", p->name, p->defn);
+ char *real;
+
+ if (mimic_gnu) {
+ if ((p->type & TYPEMASK) == MACRTYPE)
+ fprintf(stderr, "%s:\t%s\n", p->name, p->defn);
+ else {
+ real = builtin_realname(p->type);
+ if (real == NULL)
+ real = null;
+ fprintf(stderr, "%s:\t<%s>\n", p->name, real);
+ }
+ } else
+ fprintf(stderr, "`%s'\t`%s'\n", p->name, p->defn);
}
/*