#! /bin/sh /usr/share/dpatch/dpatch-run ## 02-check-existance.dpatch by René van Bevern ## DP: Check if a font file _really_ exists before trying to load it ## DP: and prevent otherwise occuring segfaults, #364386 @DPATCH@ --- texmacs-1.0.6.orig/src/Plugins/Metafont/tex_files.cpp +++ texmacs-1.0.6/src/Plugins/Metafont/tex_files.cpp @@ -19,6 +19,7 @@ #include "analyze.hpp" #include "timer.hpp" #include "data_cache.hpp" +#include static url the_tfm_path= url_none (); static url the_pk_path = url_none (); @@ -79,7 +80,8 @@ string s= as_string (name); if (is_cached ("font_cache.scm", s)) { url u= url_system (cache_get ("font_cache.scm", s) -> label); - if (exists (u)) return u; + if (exists (u) && (access(as_charp(concretize(u)), F_OK) == 0)) + return u; cache_reset ("font_cache.scm", s); }