aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-filter-search.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-01-23 12:37:59 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-01-23 12:37:59 +0800
commit4cf9b5a00cb088a3d40974f48b69120afcaf1b68 (patch)
treeaf8502deb7d160d121e63bb2e5de2b5671f89850 /camel/camel-filter-search.c
parent73053088aa1a33486a1bfb9637bf37f8bf984a18 (diff)
downloadgsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.tar
gsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.tar.gz
gsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.tar.bz2
gsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.tar.lz
gsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.tar.xz
gsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.tar.zst
gsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.zip
Perform error checking on parsing/execution.
2001-01-23 Not Zed <NotZed@Ximian.com> * camel-filter-search.c (camel_filter_search_match): Perform error checking on parsing/execution. * camel-folder-search.c (camel_folder_search_execute_expression): Perform error handling on search expression. (CamelFolderSearchPrivate): Add a camelexception for error returns. (camel_folder_search_execute_expression): Setup exception pointer. (search_match_all): Quit on error. * providers/imap/camel-imap-summary.c (message_info_load): Removed some debug 'warnings', as they should now be displayed at the toplevel loader, and just made the code match similar code elsewhere. * providers/local/camel-mbox-summary.c (message_info_load): Error handling. (message_info_save): more error handling. * camel-folder-summary.c (message_info_load): Add error handling and sanity checking. (camel_folder_summary_load): Add error checks. (perform_content_info_load): Error + sanity checks. (content_info_load): error + sanity checks. svn path=/trunk/; revision=7739
Diffstat (limited to 'camel/camel-filter-search.c')
-rw-r--r--camel/camel-filter-search.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index 5663bf622f..c8c5290d37 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -615,16 +615,29 @@ gboolean camel_filter_search_match(CamelMimeMessage *message, CamelMessageInfo *
}
e_sexp_input_text (sexp, expression, strlen (expression));
- e_sexp_parse (sexp);
+ if (e_sexp_parse (sexp) == -1) {
+ if (!camel_exception_is_set(ex))
+ camel_exception_setv(ex, 1, _("Error executing filter search: %s: %s"), e_sexp_error(sexp), expression);
+ goto error;
+ }
result = e_sexp_eval (sexp);
-
+ if (result == NULL) {
+ if (!camel_exception_is_set(ex))
+ camel_exception_setv(ex, 1, _("Error executing filter search: %s: %s"), e_sexp_error(sexp), expression);
+ goto error;
+ }
+
if (result->type == ESEXP_RES_BOOL)
retval = result->value.bool;
else
retval = FALSE;
- e_sexp_unref(sexp);
e_sexp_result_free (result);
+ e_sexp_unref(sexp);
return retval;
+
+error:
+ e_sexp_unref(sexp);
+ return FALSE;
}