summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/kpathsea/ChangeLog6
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.c19
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 <karl@tug.org>
+
+ * 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 <karl@tug.org>
* 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;