summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-10-17 09:22:23 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-10-17 09:22:23 +0400
commitd556ebf9b8a36596d752e284d227173c852d4eb8 (patch)
tree07a51d0d0fcbeb4b9df8bd8645a53e0c909e34ff /src/buffer.c
parentf0863a54681cfe7d40a0844bd2ce812eed408002 (diff)
downloademacs-d556ebf9b8a36596d752e284d227173c852d4eb8.tar.gz
* buffer.c (Fkill_buffer): When unchaining the marker,
reset it's buffer pointer to NULL (Bug#12652).
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 8e77db66d43..0b3dde27968 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1881,19 +1881,20 @@ cleaning up all windows currently displaying the buffer to be killed. */)
if (b->base_buffer)
{
- { /* Unchain all markers that belong to this indirect buffer.
- Don't unchain the markers that belong to the base buffer
- or its other indirect buffers. */
- struct Lisp_Marker **mp;
- for (mp = &BUF_MARKERS (b); *mp; )
- {
- struct Lisp_Marker *m = *mp;
- if (m->buffer == b)
+ /* Unchain all markers that belong to this indirect buffer.
+ Don't unchain the markers that belong to the base buffer
+ or its other indirect buffers. */
+ struct Lisp_Marker **mp = &BUF_MARKERS (b);
+ while ((m = *mp))
+ {
+ if (m->buffer == b)
+ {
+ m->buffer = NULL;
*mp = m->next;
- else
- mp = &m->next;
- }
- }
+ }
+ else
+ mp = &m->next;
+ }
}
else
{