mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
* insetcite.C (getNatbibLabel): prevent filesystem exception
if the bib file is in a non-readable directory (bug 2782). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14807 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9be166025a
commit
4758d556c9
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "frontends/controllers/biblio.h"
|
#include "frontends/controllers/biblio.h"
|
||||||
|
|
||||||
|
#include "support/fs_extras.h"
|
||||||
#include "support/lstrings.h"
|
#include "support/lstrings.h"
|
||||||
|
|
||||||
#include <boost/filesystem/operations.hpp>
|
#include <boost/filesystem/operations.hpp>
|
||||||
@ -70,8 +71,8 @@ string const getNatbibLabel(Buffer const & buffer,
|
|||||||
for (vector<string>::const_iterator it = bibfilesCache.begin();
|
for (vector<string>::const_iterator it = bibfilesCache.begin();
|
||||||
it != bibfilesCache.end(); ++ it) {
|
it != bibfilesCache.end(); ++ it) {
|
||||||
string const f = *it;
|
string const f = *it;
|
||||||
if (!fs::exists(f)) {
|
if (!fs::exists(f) || !fs::is_readable(fs::path(f).branch_path())) {
|
||||||
lyxerr << "Couldn't find bibtex file " << f << endl;
|
lyxerr << "Couldn't find or read bibtex file " << f << endl;
|
||||||
changed = true;
|
changed = true;
|
||||||
} else if (bibfileStatus[f] != fs::last_write_time(f)) {
|
} else if (bibfileStatus[f] != fs::last_write_time(f)) {
|
||||||
changed = true;
|
changed = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user