From d556ebf9b8a36596d752e284d227173c852d4eb8 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 17 Oct 2012 09:22:23 +0400 Subject: * buffer.c (Fkill_buffer): When unchaining the marker, reset it's buffer pointer to NULL (Bug#12652). --- src/buffer.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/buffer.c') 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 { -- cgit v1.2.1