From d6fa96a61fbded6a8c4cea832bd6ad225202b30e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Feb 2012 11:27:03 +0200 Subject: [PATCH] Fix bug #10696 with crash when an empty display string is at BOB. src/keyboard.c (adjust_point_for_property): Don't position point before BEGV. --- src/ChangeLog | 5 +++++ src/keyboard.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index d6decb7b40e..40ad7a9f507 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-02-04 Eli Zaretskii + + * keyboard.c (adjust_point_for_property): Don't position point + before BEGV. (Bug#10696) + 2012-02-03 Paul Eggert Handle overflow when computing char display width (Bug#9496). diff --git a/src/keyboard.c b/src/keyboard.c index c92f8f3f806..d4ff3c58f9b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1749,7 +1749,9 @@ adjust_point_for_property (EMACS_INT last_pt, int modified) { xassert (end > PT); SET_PT (PT < last_pt - ? (STRINGP (val) && SCHARS (val) == 0 ? beg - 1 : beg) + ? (STRINGP (val) && SCHARS (val) == 0 + ? max (beg - 1, BEGV) + : beg) : end); check_composition = check_invisible = 1; } -- 2.39.2