diff --git a/ChangeLog b/ChangeLog index 64d78f5e5a..1dffb4254a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-11-11 Sven Neumann + + Bug 557830 – PDB browser chokes as you are entering regex + characters + + * libgimp/gimpprocbrowserdialog.c: check if the query is a valid + regex before calling gimp_procedural_db_query(). + 2008-11-11 Michael Natterer * app/core/gimpitem.c: add read-only "offset-x" and "offset-y" diff --git a/libgimp/gimpprocbrowserdialog.c b/libgimp/gimpprocbrowserdialog.c index dc2ef08972..22b889cb7f 100644 --- a/libgimp/gimpprocbrowserdialog.c +++ b/libgimp/gimpprocbrowserdialog.c @@ -367,9 +367,25 @@ browser_search (GimpBrowser *browser, gint search_type, GimpProcBrowserDialog *dialog) { - gchar **proc_list; - gint num_procs; - gchar *str; + gchar **proc_list; + gint num_procs; + gchar *str; + GRegex *regex; + + /* first check if the query is a valid regex */ + regex = g_regex_new (query_text, 0, 0, NULL); + + if (! regex) + { + gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->tree_view), NULL); + dialog->store = NULL; + + gimp_browser_show_message (browser, + _("Search term invalid or incomplete")); + return; + } + + g_regex_unref (regex); switch (search_type) {