aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-11 09:11:12 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-11 15:38:02 +0000
commit1f808781f4b92ff8ca5dfc476065ede8c18a076e (patch)
tree17e2f0c9198003bae93b11e058c68fbe76d3be27
parentinput: call selection_finalize() when BTN_LEFT is released (diff)
selection: selection_finalize() ignores invalid selections
-rw-r--r--selection.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/selection.c b/selection.c
index 8860ef88..cedf8d10 100644
--- a/selection.c
+++ b/selection.c
@@ -66,6 +66,9 @@ selection_finalize(struct terminal *term)
if (!selection_enabled(term))
return;
+ if (term->selection.start.row == -1 || term->selection.end.row == -1)
+ return;
+
assert(term->selection.start.row != -1);
assert(term->selection.end.row != -1);
}