fix LOAD purging old loaded rules
authorChristian Thaeter <ct@pipapo.org>
Mon, 8 Oct 2007 16:23:08 +0000 (18:23 +0200)
committerChristian Thaeter <ct@pipapo.org>
Mon, 8 Oct 2007 16:23:08 +0000 (18:23 +0200)
rxpd.c

diff --git a/rxpd.c b/rxpd.c
index 8ca6a57..1440882 100644 (file)
--- a/rxpd.c
+++ b/rxpd.c
@@ -177,6 +177,13 @@ rxpd_file_load (struct rxpd_file* self)
   // TODO error handling
   if (f)
     {
+      /* First purge old rules */
+      LLIST_WHILE_HEAD (&self->rules, n)
+        {
+          struct rxpd_rule* node = (struct rxpd_rule*)n;
+          rxpd_rule_delete (node);
+        }
+      
       // TODO test excess line length = error
       char buf[4096];