]> git.eshelyaron.com Git - emacs.git/commitdiff
(direct_output_forward_char): Fix previous change:
authorRichard M. Stallman <rms@gnu.org>
Wed, 11 Aug 1993 05:24:29 +0000 (05:24 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 11 Aug 1993 05:24:29 +0000 (05:24 +0000)
verify position is in range before calling Fget_text_property,
and calculate position properly.

src/dispnew.c

index db909505f050932e8276d6916212a96154e20312..06dcebc41dcc7d7eaff1460ae7602e09cb79af75 100644 (file)
@@ -942,16 +942,18 @@ direct_output_forward_char (n)
   /* Don't use direct output next to an invisible character
      since we might need to do something special.  */
 
-  XFASTINT (position) = point + n;
-  if (! NILP (Fget_text_property (position,
-                                 Qinvisible,
-                                 Fcurrent_buffer ())))
+  XFASTINT (position) = point;
+  if (XFASTINT (position) < ZV
+      && ! NILP (Fget_text_property (position,
+                                    Qinvisible,
+                                    Fcurrent_buffer ())))
     return;
 
-  XFASTINT (position) = point + n - 1;
-  if (! NILP (Fget_text_property (position,
-                                 Qinvisible,
-                                 Fcurrent_buffer ())))
+  XFASTINT (position) = point - 1;
+  if (XFASTINT (position) >= BEGV
+      && ! NILP (Fget_text_property (position,
+                                    Qinvisible,
+                                    Fcurrent_buffer ())))
     return;
 #endif