aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--selection.c10
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e6914905..4fa2fc0e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -128,6 +128,8 @@
multi-column character in the last column ([#2411][2411]).
* `reallocarray()` is no longer required, so as to support platforms
where libc doesn't include it (e.g. Termux + Android API < 29).
+* Crash in `select-quote` when the right-side quote appeared right
+ after a newline, in column 0 ([#2405][2405]).
[2353]: https://codeberg.org/dnkl/foot/issues/2353
[2352]: https://codeberg.org/dnkl/foot/issues/2352
@@ -138,6 +140,7 @@
[2364]: https://codeberg.org/dnkl/foot/issues/2364
[2397]: https://codeberg.org/dnkl/foot/issues/2397
[2411]: https://codeberg.org/dnkl/foot/issues/2411
+[2405]: https://codeberg.org/dnkl/foot/issues/2405
### Security
diff --git a/selection.c b/selection.c
index c58457d8..fb8c560a 100644
--- a/selection.c
+++ b/selection.c
@@ -597,9 +597,13 @@ selection_find_quote_right(struct terminal *term, struct coord *pos, char32_t qu
wc = row->cells[next_col].wc;
if (wc == quote_char) {
- pos->row = next_row;
- pos->col = next_col - 1;
- xassert(pos->col >= 0);
+ if (next_col == 0) {
+ pos->row = next_row - 1;
+ pos->col = term->cols - 1;
+ } else {
+ pos->row = next_row;
+ pos->col = next_col - 1;
+ }
return true;
}
}