From 0bc23ba9a5357242cf0a72b12a3a3a393d248e94 Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 22 Aug 2005 23:24:35 +0000 Subject: [PATCH] fix filter git-svn-id: http://ltt.polymtl.ca/svn@1053 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/filter.c | 1 + ltt/branches/poly/lttv/modules/text/batchAnalysis.c | 2 +- ltt/branches/poly/lttv/modules/text/textDump.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/filter.c b/ltt/branches/poly/lttv/lttv/filter.c index e837068c..556bf179 100644 --- a/ltt/branches/poly/lttv/lttv/filter.c +++ b/ltt/branches/poly/lttv/lttv/filter.c @@ -1537,6 +1537,7 @@ lttv_filter_append_expression(LttvFilter* filter, const char *expression) { if(expression == NULL) return FALSE; if(filter == NULL) return FALSE; + if(expression[0] == '\0') return FALSE; /* Empty expression */ GString* s = g_string_new(""); if(filter->expression != NULL) { diff --git a/ltt/branches/poly/lttv/modules/text/batchAnalysis.c b/ltt/branches/poly/lttv/modules/text/batchAnalysis.c index 785ff1a8..ebb2248f 100644 --- a/ltt/branches/poly/lttv/modules/text/batchAnalysis.c +++ b/ltt/branches/poly/lttv/modules/text/batchAnalysis.c @@ -92,7 +92,7 @@ static gboolean process_traceset(void *hook_data, void *call_data) *(value_filter.v_pointer) = lttv_filter_new(); g_debug("Filter string: %s",((GString*)*(value_expression.v_pointer))->str); - g_assert(lttv_filter_append_expression(*(value_filter.v_pointer),((GString*)*(value_expression.v_pointer))->str)); + lttv_filter_append_expression(*(value_filter.v_pointer),((GString*)*(value_expression.v_pointer))->str); //lttv_traceset_context_add_hooks(tc, //before_traceset, after_traceset, NULL, before_trace, after_trace, diff --git a/ltt/branches/poly/lttv/modules/text/textDump.c b/ltt/branches/poly/lttv/modules/text/textDump.c index 1335afc4..96773a6c 100644 --- a/ltt/branches/poly/lttv/modules/text/textDump.c +++ b/ltt/branches/poly/lttv/modules/text/textDump.c @@ -366,9 +366,9 @@ static int write_event_content(void *hook_data, void *call_data) /* * call to the filter if available */ - if(!lttv_filter_tree_parse(filter->head,e,tfc->tf,tfc->t_context->t,tfs->process,tfc)) { + if(filter->head != NULL) + if(!lttv_filter_tree_parse(filter->head,e,tfc->tf,tfc->t_context->t,tfs->process,tfc)) return FALSE; - } lttv_event_to_string(e, a_string, TRUE, a_field_names, tfs); g_string_append_printf(a_string,"\n"); -- 2.34.1