diff options
author | Richard M. Stallman <[email protected]> | 1993-08-11 05:24:29 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1993-08-11 05:24:29 +0000 |
commit | 2f24f5ac0cba52614dd6153e689bc1827af432e1 (patch) | |
tree | 06e50954c91a6d6e7a05a8e5a57eb1b708fd3cb0 /src/dispnew.c | |
parent | 5c781212c8c50d560c26258f9b8e102b2688aed3 (diff) |
(direct_output_forward_char): Fix previous change:
verify position is in range before calling Fget_text_property,
and calculate position properly.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r-- | src/dispnew.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index db909505f0..06dcebc41d 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 |