summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2010-06-12 21:53:40 -0400
committerJason Woodward2010-06-12 21:53:40 -0400
commit6d5f241d97261adde767292b129f45de18ea3405 (patch)
tree0f2a0cda6dc0ba32d9d68e6ddf0dcc082b51ed05
parent315398c2da277b1b12fc7769033d576a4c36b16f (diff)
downloadgslapt-6d5f241d97261adde767292b129f45de18ea3405.tar.gz
do not try and match package series on an empty search
-rw-r--r--src/callbacks.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index 46483c4..55e2231 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -704,10 +704,10 @@ void build_searched_treeviewlist (GtkWidget *treeview, gchar *pattern)
if (pattern == NULL || (strcmp(pattern,"") == 0)) {
reset_search_list();
+ } else {
+ series_regex = slapt_init_regex(pattern);
}
- series_regex = slapt_init_regex(pattern);
-
package_model = GTK_TREE_MODEL_SORT(gtk_tree_view_get_model(GTK_TREE_VIEW(treeview)));
filter_model = GTK_TREE_MODEL_FILTER(gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(package_model)));
@@ -772,7 +772,9 @@ void build_searched_treeviewlist (GtkWidget *treeview, gchar *pattern)
valid = gtk_tree_model_iter_next(base_model,&iter);
}
- slapt_free_regex(series_regex);
+ if (series_regex != NULL)
+ slapt_free_regex(series_regex);
+
slapt_free_pkg_list(a_matches);
slapt_free_pkg_list(i_matches);
}