From 0751fea95578c17539d152415659b029f67bc3b7 Mon Sep 17 00:00:00 2001 From: Philip Guenthe Date: Fri, 26 Jun 2009 22:03:18 +0000 Subject: 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!) --- usr.bin/m4/look.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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(¯os, &i); n != NULL; n = ohash_next(¯os, &i)) - f(n->name, n->d); + if (n->d != NULL) + f(n->name, n->d); } void -- cgit v1.2.3