src/utils_ignorelist.c: Allow the `entry' argument to be NULL/empty.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 20 Nov 2006 17:15:39 +0000 (18:15 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 20 Nov 2006 17:15:39 +0000 (18:15 +0100)
Also assert the object to be non-empty.

src/utils_ignorelist.c

index 31a3e66..27eb987 100644 (file)
@@ -333,10 +333,15 @@ int ignorelist_match (ignorelist_t *il, const char *entry)
 {
        ignorelist_item_t *traverse;
 
+       assert (il != NULL);
+
        /* if no entries, collect all */
        if (il->head == NULL)
                return (0);
 
+       if ((entry == NULL) || (strlen (entry) == 0))
+               return (0);
+
        /* traverse list and check entries */
        for (traverse = il->head; traverse != NULL; traverse = traverse->next)
        {