fix bugs in prefs_filtering_delete_path
authorColin Leroy <colin@colino.net>
Thu, 28 Nov 2002 11:17:44 +0000 (11:17 +0000)
committerColin Leroy <colin@colino.net>
Thu, 28 Nov 2002 11:17:44 +0000 (11:17 +0000)
ChangeLog.claws
configure.in
src/prefs_filtering.c

index 3169c21..6f83893 100644 (file)
@@ -1,3 +1,12 @@
+2002-11-27 [colin]     0.8.6claws23
+
+       * src/prefs_filtering.c
+               Fix problems with prefs_filtering_delete_path:
+               a) if the first rule is removed, original pointers
+                  weren't updated (leading to segfaults)
+               b) it was always global_processing updated in case
+                  of removed path was parent of rule path
+
 2002-11-27 [paul]      0.8.6claws22
 
        * src/mainwindow.c
index 9a5085b..db00691 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws22
+EXTRA_VERSION=claws23
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 30b8347..549737a 100644 (file)
@@ -771,17 +771,24 @@ static gboolean prefs_filtering_delete_path_func(GNode *node, gpointer data)
 
                        if (suffix && !strncmp(path, suffix, pathlen)) {
                                filteringprop_free(filtering);
-                               global_processing = 
-                                       g_slist_remove(global_processing, filtering);
+                               orig = g_slist_remove(orig, filtering);
                        }
                } else if (strcmp(action->destination, path) == 0) {
                        filteringprop_free(filtering);
-                       orig = 
-                               g_slist_remove(orig, filtering);
+                       orig = g_slist_remove(orig, filtering);
 
                }
        }
 
+       if (node == NULL)
+               global_processing = orig;
+       else {
+               item = node->data;
+               if (!item || !item->prefs)
+                       return FALSE;
+               item->prefs->processing = orig;
+       }
+
        prefs_matcher_write_config();
 
        return FALSE;