diff options
author | Lute Kamstra <lute@gnu.org> | 2005-04-09 08:42:30 +0000 |
---|---|---|
committer | Lute Kamstra <lute@gnu.org> | 2005-04-09 08:42:30 +0000 |
commit | e686c8a1b739de2a29fa75a29848574fbebcf797 (patch) | |
tree | 65422043795d7775c6cf1225ea67201b1ac1e4ae | |
parent | e9d813f6ad60810ca673de8ea1fa6515023c95eb (diff) | |
download | emacs-e686c8a1b739de2a29fa75a29848574fbebcf797.tar.gz |
(PRINTPREPARE): Check if the marker PRINTCHARFUN is within the
accessible part of the buffer.
-rw-r--r-- | src/print.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/print.c b/src/print.c index 8bb55f21248..47e338e8492 100644 --- a/src/print.c +++ b/src/print.c @@ -1,6 +1,6 @@ /* Lisp object printing and output streams. - Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 01, 03, 2004 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, + 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -211,13 +211,17 @@ void print_interval (); } \ if (MARKERP (printcharfun)) \ { \ - if (!(XMARKER (original)->buffer)) \ + EMACS_INT marker_pos; \ + if (!(XMARKER (printcharfun)->buffer)) \ error ("Marker does not point anywhere"); \ - if (XMARKER (original)->buffer != current_buffer) \ - set_buffer_internal (XMARKER (original)->buffer); \ + if (XMARKER (printcharfun)->buffer != current_buffer) \ + set_buffer_internal (XMARKER (printcharfun)->buffer); \ + marker_pos = marker_position (printcharfun); \ + if (marker_pos < BEGV || marker_pos > ZV) \ + error ("Marker is outside the accessible part of the buffer"); \ old_point = PT; \ old_point_byte = PT_BYTE; \ - SET_PT_BOTH (marker_position (printcharfun), \ + SET_PT_BOTH (marker_pos, \ marker_byte_position (printcharfun)); \ start_point = PT; \ start_point_byte = PT_BYTE; \ |