[PATCH] : filters



	Hi all,
this is a 2 liner that fixes a bug in the loading code of filters 
sections, that leads to corrupted filters (you must have at least 10 
filters to trigger this bug). The problem came from the fact that to find 
the config section corresponding to the conditions of a filter, I looked 
only at part of the section name, therefore creating ambiguity that was 
responsible of attributing too many config sections to certain filter 
conditions.
Briefly this is a short but important fix.
This bug was uncovered by James (McPherson) a long time ago, in the 
meantime I corrected one bug related to the problem he described, but this 
one remained for too long ;-) Hopefully he reminded me that someone was 
still broken.
Patch is against current cvs.
Bye
Manu
--- ../balsa-cvs/balsa/libbalsa/filter-file.c	Sun Feb 24 16:27:43 2002
+++ balsa-cvs/balsa/libbalsa/filter-file.c	Sun Mar 10 15:07:47 2002
@@ -156,7 +156,7 @@
     LibBalsaCondition* cond;
     void *iterator;
     gchar *tmp,* condprefix,*key;
-    gint pref_len=strlen(CONDITION_SECTION_PREFIX)+strlen(filter_section_name);
+    gint pref_len=strlen(CONDITION_SECTION_PREFIX)+strlen(filter_section_name)+1;
     gint err=FILTER_NOERR;
     GList * tmp_list=NULL;
     GList *l;
@@ -164,7 +164,7 @@
     FILTER_SETFLAG(fil,FILTER_VALID);
     FILTER_SETFLAG(fil,FILTER_COMPILED);
 
-    tmp=g_strconcat(CONDITION_SECTION_PREFIX,filter_section_name,NULL);
+    tmp=g_strconcat(CONDITION_SECTION_PREFIX,filter_section_name,":",NULL);
     iterator = gnome_config_init_iterator_sections(prefix);
     filter_errno=FILTER_NOERR;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]