From d3956140c2757a5929d4517cf54e5d9c06e11355 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 26 Jun 2009 16:24:55 +0300 Subject: Handle hook unregistering itself --- rpmio/rpmhook.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpmio/rpmhook.c b/rpmio/rpmhook.c index 6c9b63acf..bece9da04 100644 --- a/rpmio/rpmhook.c +++ b/rpmio/rpmhook.c @@ -205,10 +205,12 @@ static void rpmhookTableCallArgs(rpmhookTable *table, const char *name, { int n = rpmhookTableFindBucket(table, name); rpmhookItem item = (*table)->bucket[n].item; + rpmhookItem next; while (item) { + next = item->next; if (item->func(args, item->data) != 0) break; - item = item->next; + item = next; } } -- cgit v1.2.3