diff options
author | Karl Berry <karl@freefriends.org> | 2009-12-19 23:14:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-12-19 23:14:46 +0000 |
commit | 90688d404856ed9a20ad5d714a1999acd388d88e (patch) | |
tree | 101f6c6610f21c83dd5d3c511a3acd8b72c38efc /Build/source/texk/kpathsea/kpsewhich.c | |
parent | 929d8005a93b27f29b4ed481f31d62f92f67d28b (diff) |
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
Diffstat (limited to 'Build/source/texk/kpathsea/kpsewhich.c')
-rw-r--r-- | Build/source/texk/kpathsea/kpsewhich.c | 19 |
1 files changed, 17 insertions, 2 deletions
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; |