From: Georg Baum Date: Sun, 23 Feb 2014 11:33:15 +0000 (+0100) Subject: Fix crash on recursive include (bug #8994) X-Git-Tag: 2.1.0rc1~166 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=52072b9b4e88e3260637b654d364193092d04192;p=features.git Fix crash on recursive include (bug #8994) The problem was that collectBibKeys() was called before the recursive include check was done. Now collectBibKeys() works even for recursive includes, and your get a proper error message if you try to change the file name to the parent file. --- diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index fe0c1edae4..d53166267b 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -407,7 +407,9 @@ Buffer * InsetInclude::getChildBuffer() const { Buffer * childBuffer = loadIfNeeded(); - // FIXME: recursive includes + // FIXME RECURSIVE INCLUDE + // This isn't sufficient, as the inclusion could be downstream. + // But it'll have to do for now. return (childBuffer == &buffer()) ? 0 : childBuffer; } @@ -972,6 +974,11 @@ void InsetInclude::collectBibKeys(InsetIterator const & /*di*/) const Buffer * child = loadIfNeeded(); if (!child) return; + // FIXME RECURSIVE INCLUDE + // This isn't sufficient, as the inclusion could be downstream. + // But it'll have to do for now. + if (child == &buffer()) + return; child->collectBibKeys(); }