From 2f24f5ac0cba52614dd6153e689bc1827af432e1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 11 Aug 1993 05:24:29 +0000 Subject: [PATCH] (direct_output_forward_char): Fix previous change: verify position is in range before calling Fget_text_property, and calculate position properly. --- src/dispnew.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index db909505f05..06dcebc41dc 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -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 -- 2.39.5