[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/fix-the-long-lines-display-bug 6a097a8621: Shorter and safer fix
From: |
Gregory Heytings |
Subject: |
feature/fix-the-long-lines-display-bug 6a097a8621: Shorter and safer fix for the segfault. |
Date: |
Mon, 18 Jul 2022 10:07:35 -0400 (EDT) |
branch: feature/fix-the-long-lines-display-bug
commit 6a097a86210cf1226d432b255cc41aa74fe93507
Author: Gregory Heytings <gregory@heytings.org>
Commit: Gregory Heytings <gregory@heytings.org>
Shorter and safer fix for the segfault.
* src/xdisp.c (get_visually_first_element): Shorter and safer fix for
the segfault. Improves the fix introduced in cc7f37b2a4.
---
src/xdisp.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index d69d7440bc..572ad2b854 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8668,18 +8668,11 @@ get_visually_first_element (struct it *it)
bool string_p = STRINGP (it->string) || it->s;
ptrdiff_t eob = (string_p ? it->bidi_it.string.schars : ZV);
ptrdiff_t bob;
+ ptrdiff_t obegv = BEGV;
- SET_WITH_NARROWED_BEGV (it, bob, string_p ? 0 : BEGV);
-
- /* Reseat again when, as a consequence of the SET_WITH_NARROWED_BEGV
- above, the iterator is before bob. */
- if (!string_p && IT_CHARPOS (*it) < bob)
- {
- struct text_pos pos;
- pos.charpos = bob;
- pos.bytepos = CHAR_TO_BYTE (bob);
- reseat (it, pos, true);
- }
+ SET_WITH_NARROWED_BEGV (it, bob,
+ string_p ? 0 :
+ IT_BYTEPOS (*it) < BEGV ? obegv : BEGV);
if (STRINGP (it->string))
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- feature/fix-the-long-lines-display-bug 6a097a8621: Shorter and safer fix for the segfault.,
Gregory Heytings <=