aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/search.c b/src/search.c
index 856d079..89bf688 100644
--- a/src/search.c
+++ b/src/search.c
@@ -603,6 +603,11 @@ teco_do_search(GRegex *re, gsize from, gsize to, gint *count, GError **error)
g_propagate_error(error, tmp_error);
return FALSE;
}
+
+ if (G_UNLIKELY(teco_interface_is_interrupted())) {
+ teco_error_interrupted_set(error);
+ return FALSE;
+ }
}
if (!*count)
@@ -659,6 +664,13 @@ teco_do_search(GRegex *re, gsize from, gsize to, gint *count, GError **error)
return FALSE;
}
+ if (G_UNLIKELY(teco_interface_is_interrupted())) {
+ teco_error_interrupted_set(error);
+ for (int i = 0; i < matched_num; i++)
+ g_free(matched[i].ranges);
+ return FALSE;
+ }
+
i = ++matched_total % -(*count);
}