Fix bug #10696 with crash when an empty display string is at BOB.
authorEli Zaretskii <eliz@gnu.org>
Sat, 4 Feb 2012 09:27:03 +0000 (11:27 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 4 Feb 2012 09:27:03 +0000 (11:27 +0200)
 src/keyboard.c (adjust_point_for_property): Don't position point
 before BEGV.

src/ChangeLog
src/keyboard.c

index d6decb7..40ad7a9 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * keyboard.c (adjust_point_for_property): Don't position point
+       before BEGV.  (Bug#10696)
+
 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        Handle overflow when computing char display width (Bug#9496).
index c92f8f3..d4ff3c5 100644 (file)
@@ -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;
        }