From: Enrico Forestieri Date: Tue, 8 Sep 2015 23:40:16 +0000 (+0200) Subject: Take into account symbolic links X-Git-Tag: 2.2.0alpha1~359 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e626184fd04394a6f92840d504abb229a1ccf408;p=features.git Take into account symbolic links 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. --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 6f0673f30a..df2e00c8f3 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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;