From d9e68dc1b2f99a2f14e9b5ae6404d39fca7fb297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sat, 19 Aug 2006 10:37:57 +0000 Subject: [PATCH] * 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/branches/BRANCH_1_4_X@14806 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 5 +++++ src/insets/insetcite.C | 5 +++-- status.14x | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 79552044fc..89ac6b3333 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2006-08-19 Jürgen Spitzmüller + + * insetcite.C (getNatbibLabel): prevent filesystem exception + if the bib file is in a non-readable directory (bug 2782). + 2006-08-18 Jürgen Spitzmüller * insetcite.C (getNatbibLabel): prevent filesystem exception diff --git a/src/insets/insetcite.C b/src/insets/insetcite.C index ff2ee37b94..bcc8e1cd7d 100644 --- a/src/insets/insetcite.C +++ b/src/insets/insetcite.C @@ -23,6 +23,7 @@ #include "frontends/controllers/biblio.h" +#include "support/fs_extras.h" #include "support/lstrings.h" #include @@ -70,8 +71,8 @@ string const getNatbibLabel(Buffer const & buffer, for (vector::const_iterator it = bibfilesCache.begin(); it != bibfilesCache.end(); ++ it) { string const f = *it; - if (!fs::exists(f)) { - lyxerr << "Couldn't find bibtex file " << f << endl; + if (!fs::exists(f) || !fs::is_readable(fs::path(f).branch_path())) { + lyxerr << "Couldn't find or read bibtex file " << f << endl; changed = true; } else if (bibfileStatus[f] != fs::last_write_time(f)) { changed = true; diff --git a/status.14x b/status.14x index ef1a6f9dcb..54d656fe7d 100644 --- a/status.14x +++ b/status.14x @@ -36,7 +36,8 @@ What's new - Fix crash when importing LaTeX files with no text (bug 2667) -- Fix crash when a used bibtex file does not exist. +- Fix crash when a used bibtex file is in a non-readable directory + (bug 2782). - Ignore definition of lyxgreyout environment when re-importing a LyX generated LaTeX file (part of bug 2420)