From be6335128da92389defd81dc58132387f1f400d8 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 17 Mar 2001 23:54:01 +0000 Subject: Since we are now using filter-option widgets in place of system-flag, we 2001-03-17 Jeffrey Stedfast * filter-option.c (build_code): Since we are now using filter-option widgets in place of system-flag, we do not need a "code" part so if there isn't a code part, don't build it. (clone): Updated to allow NULL code parts. svn path=/trunk/; revision=8789 --- filter/filter-option.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'filter/filter-option.c') diff --git a/filter/filter-option.c b/filter/filter-option.c index 6a81c75f95..3992c9e46a 100644 --- a/filter/filter-option.c +++ b/filter/filter-option.c @@ -193,7 +193,7 @@ xml_create (FilterElement *fe, xmlNodePtr node) work = work->next; } d(printf ("creating new option:\n title %s\n value %s\n code %s\n", - op->title, op->value, op->code)); + op->title, op->value, op->code ? op->code : "none")); fo->options = g_list_append (fo->options, op); if (fo->current == NULL) fo->current = op; @@ -296,7 +296,7 @@ build_code (FilterElement *fe, GString *out, struct _FilterPart *ff) d(printf ("building option code %p, current = %p\n", fo, fo->current)); - if (fo->current) { + if (fo->current && fo->current->code) { filter_part_expand_code (ff, fo->current->code, out); } } @@ -328,7 +328,10 @@ clone (FilterElement *fe) d(printf (" option %s\n", op->title)); fn->title = g_strdup (op->title); fn->value = g_strdup (op->value); - fn->code = g_strdup (op->code); + if (op->code) + fn->code = g_strdup (op->code); + else + fn->code = NULL; new->options = g_list_append (new->options, fn); l = g_list_next (l); -- cgit