aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-31 10:39:23 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-07 15:33:31 +0000
commit2315aba458b662dcbb2ce4b8ceb3d9bfd14f4970 (patch)
tree563f7dfa6127d394e8fe48fa4c5703b80ca20630
parenturl-mode: fix ‘n’ parameter to wcstombs() (diff)
url-mode: urls_reset() do an early return if we don’t have any URLs
-rw-r--r--url-mode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/url-mode.c b/url-mode.c
index 0f23845c..170be4c9 100644
--- a/url-mode.c
+++ b/url-mode.c
@@ -321,6 +321,9 @@ urls_collect(struct terminal *term)
void
urls_reset(struct terminal *term)
{
+ if (likely(tll_length(term->urls) == 0))
+ return;
+
if (term->window != NULL) {
tll_foreach(term->window->urls, it) {
if (it->item.sub_surf != NULL)