summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2014-02-09 18:52:04 +0100
committerYorhel <git@yorhel.nl>2014-02-10 13:52:33 +0100
commitd4522ae789d7050cc7dafad6ca3a634da7d7a83d (patch)
treec767a49e870f3c5ea6768d2e27474ae1108cc9f1
parenta22a44b334532401bd55ca0fc59dc8b49bf9bbae (diff)
search: Fix crash when searching an empty list
Broken in 7a8c5d0f6758a4cd38b828f9dabc23de77d5b72b
-rw-r--r--src/ui_util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ui_util.c b/src/ui_util.c
index 70fb70c..45c6151 100644
--- a/src/ui_util.c
+++ b/src/ui_util.c
@@ -1188,6 +1188,8 @@ void ui_listing_free(ui_listing_t *ul) {
// search next/previous
static void ui_listing_search_advance(ui_listing_t *ul, GSequenceIter *startpos, gboolean prev) {
+ if(g_sequence_iter_is_end(startpos) && g_sequence_iter_is_end((startpos = ui_listing_getbegin(ul))))
+ return;
GRegex *regex = ul->query ? g_regex_new(ul->query, G_REGEX_CASELESS | G_REGEX_OPTIMIZE, 0, NULL) : NULL;
if(!regex) {
ul->match_start = REGEX_ERROR;