=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/m4/eval.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/m4/eval.c 2001/09/18 14:05:14 1.31 --- src/usr.bin/m4/eval.c 2001/09/18 14:10:55 1.32 *************** *** 1,4 **** ! /* $OpenBSD: eval.c,v 1.31 2001/09/18 14:05:14 espie Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: eval.c,v 1.32 2001/09/18 14:10:55 espie Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /* *************** *** 41,47 **** #if 0 static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95"; #else ! static char rcsid[] = "$OpenBSD: eval.c,v 1.31 2001/09/18 14:05:14 espie Exp $"; #endif #endif /* not lint */ --- 41,47 ---- #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 $"; #endif #endif /* not lint */ *************** *** 82,87 **** --- 82,88 ---- static const char *handledash __P((char *, char *, const char *)); static void expand_builtin __P((const char *[], int, int)); static void expand_macro __P((const char *[], int)); + static void dump_one_def __P((ndptr)); /* *************** *** 464,471 **** } } - char *dumpfmt = "`%s'\t`%s'\n"; /* format string for dumpdef */ - /* * expand_macro - user-defined macro expansion */ --- 465,470 ---- *************** *** 623,628 **** --- 622,637 ---- } /* + * dump_one_def - dump the specified definition. + */ + static void + dump_one_def(p) + ndptr p; + { + fprintf(stderr, "`%s'\t`%s'\n", p->name, p->defn); + } + + /* * dodumpdef - dump the specified definitions in the hash * table to stderr. If nothing is specified, the entire * hash table is dumped. *************** *** 638,650 **** if (argc > 2) { for (n = 2; n < argc; n++) if ((p = lookup(argv[n])) != nil) ! fprintf(stderr, dumpfmt, p->name, ! p->defn); } else { for (n = 0; n < HASHSIZE; n++) for (p = hashtab[n]; p != nil; p = p->nxtptr) ! fprintf(stderr, dumpfmt, p->name, ! p->defn); } } --- 647,657 ---- if (argc > 2) { for (n = 2; n < argc; n++) if ((p = lookup(argv[n])) != nil) ! dump_one_def(p); } else { for (n = 0; n < HASHSIZE; n++) for (p = hashtab[n]; p != nil; p = p->nxtptr) ! dump_one_def(p); } }