Ticket #2966: mcview: fix segfault after switch from parse to raw mode and back.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2014-12-22 21:52:33 +03:00
parent 4011bfe301
commit 7413c9c2ab

View File

@ -210,7 +210,15 @@ mcview_growbuf_read_until (mcview_t * view, off_t ofs)
g_free (err_msg);
}
mcview_growbuf_done (view);
if (view->ds_stdio_pipe != NULL)
{
/* when switch from parse to raw mode and back,
* do not close the already closed pipe after following loop:
* mcview_growbuf_read_until() -> mcview_show_error() ->
* MSG_DRAW -> mcview_display() -> mcview_get_byte() -> mcview_growbuf_read_until()
*/
mcview_growbuf_done (view);
}
mcview_display (view);
return;
}