summaryrefslogtreecommitdiff
path: root/usr.bin/m4
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2009-06-26 22:03:18 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2009-06-26 22:03:18 +0000
commit0751fea95578c17539d152415659b029f67bc3b7 (patch)
treea50281370c9fa8a32493ddcca52a1709be1b5c13 /usr.bin/m4
parentb25ed7f0adc759a78fae1ba556accf77777dc3ba (diff)
undefine() leaves the hash entry for the macro (for use by builtin()) and
only deletes the definition; macro_for_all needs to skip those to keep dumpdef() from segving ok and regress test by espie (thanks!)
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/look.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/m4/look.c b/usr.bin/m4/look.c
index a9bfe1e5433..c99cc1a8ae9 100644
--- a/usr.bin/m4/look.c
+++ b/usr.bin/m4/look.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: look.c,v 1.18 2006/01/20 23:10:19 espie Exp $ */
+/* $OpenBSD: look.c,v 1.19 2009/06/26 22:03:17 guenther Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -223,7 +223,8 @@ macro_for_all(void (*f)(const char *, struct macro_definition *))
for (n = ohash_first(&macros, &i); n != NULL;
n = ohash_next(&macros, &i))
- f(n->name, n->d);
+ if (n->d != NULL)
+ f(n->name, n->d);
}
void