From 90688d404856ed9a20ad5d714a1999acd388d88e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 19 Dec 2009 23:14:46 +0000 Subject: revert to checking kpse_fmt_format last, Angelo Graziosi, http://tug.org/pipermail/tlbuild/2009q4/001222.html git-svn-id: svn://tug.org/texlive/trunk@16452 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 6 ++++++ Build/source/texk/kpathsea/kpsewhich.c | 19 +++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index c78d74c5b60..ad7dc8b0237 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,9 @@ +2009-12-20 Karl Berry + + * kpsewhich.c (find_format): restore checking of kpse_fmt_format + last, since a hang was reported by Angelo Graziosi, + http://tug.org/pipermail/tlbuild/2009q4/001222.html. + 2009-12-17 Karl Berry * c-proto.h (KPSE_DLL) [WIN32]: #define in this case, per Akira. diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c index 7b8b6a89540..e5c278da18b 100644 --- a/Build/source/texk/kpathsea/kpsewhich.c +++ b/Build/source/texk/kpathsea/kpsewhich.c @@ -159,9 +159,24 @@ find_format (kpathsea kpse, string name, boolean is_filename) if (found) break; - } - ret = f; + /* Some trickery here: the extensions for kpse_fmt_format (which + is just .fmt) can clash with other extensions in use (how?), + and we prefer for those others to be preferred. And we don't + want to change the integer value of kpse_fmt_format. So skip + it when first encountered, then use it when we've done + everything else, and use it as the end-guard. */ + if (f == kpse_fmt_format) { + f = kpse_last_format; + } else if (++f == kpse_fmt_format) { + f++; + } else if (f == kpse_last_format) { + f = kpse_fmt_format; + } + + /* If there was a match, f will be one past the correct value. */ + ret = f; + } } return ret; -- cgit v1.2.3