]> git.lyx.org Git - features.git/commitdiff
Take into account symbolic links
authorEnrico Forestieri <forenr@lyx.org>
Tue, 8 Sep 2015 23:40:16 +0000 (01:40 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 8 Sep 2015 23:40:16 +0000 (01:40 +0200)
In order to adjust the path of an included file, when deciding
whether the document was moved or not, it is not sufficient
comparing the paths because the document could have been accessed
through a symbolic link.

src/Buffer.cpp

index 6f0673f30a1f4502ce03e6b74a6dbd99aca2202b..df2e00c8f3a4812a31aee8a338cce3b80ef36f82 100644 (file)
@@ -4949,7 +4949,8 @@ string Buffer::includedFilePath(string const & name, string const & ext) const
        // old_position already contains a trailing path separator
        string const absname = isabsolute ? name : d->old_position + name;
 
-       if (d->old_position.empty() || d->old_position == filePath()
+       if (d->old_position.empty()
+           || equivalent(FileName(d->old_position), FileName(filePath()))
            || !FileName(addExtension(absname, ext)).exists())
                return name;