* src/ConverterCache.cpp

(ConverterCache::Impl::readIndex): prevent assertion in
	fs::last_write_time for corrupted cache index


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18341 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2007-05-15 11:34:26 +00:00
parent 058d731103
commit 9c765e64de

View File

@ -123,6 +123,17 @@ void ConverterCache::Impl::readIndex()
continue;
}
// Don't add items that are not in the cache anymore
// This can happen if two instances of LyX are running
// at the same time and update the index file independantly.
if (!fs::exists(item.cache_name.toFilesystemEncoding())) {
LYXERR(Debug::FILES) << "Not caching file `"
<< orig_from
<< "' (cached copy does not exist anymore)."
<< std::endl;
continue;
}
// Delete the cached file if it is too old
if (difftime(now, fs::last_write_time(item.cache_name.toFilesystemEncoding())) >
lyxrc.converter_cache_maxage) {