From 21adf0e9685e1da4dfc7d96d8855c0e85d3eb47c Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 26 Jun 2009 16:24:55 +0300 Subject: [PATCH] Handle hook unregistering itself (cherry picked from commit d3956140c2757a5929d4517cf54e5d9c06e11355) --- rpmio/rpmhook.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpmio/rpmhook.c b/rpmio/rpmhook.c index 6c9b63a..bece9da 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; } } -- 2.7.4