diff options
author | Elie Roux <elie.roux@telecom-bretagne.eu> | 2010-05-10 10:37:31 +0300 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-05-10 11:39:15 +0200 |
commit | dd3b52c8fe08c94dde400ced4ab875e7120a126d (patch) | |
tree | f0292c3e9ea5d4f8de20812d7401543029e691ac | |
parent | 386b1aadbcf8c67201b6e35eb08a498ac1842eab (diff) | |
download | luatexbase-dd3b52c8fe08c94dde400ced4ab875e7120a126d.tar.gz |
Bug fixing in the loader
When you had gregorio.tex and gregorio.lua, the loader tried to
load gregoriotex.tex as a lua file, and obviously failed.
I added a check on the extention in the case where we look for the
name without any, and also reorganized the search order to avoid
looking for xxx.texluac before looking for xxx.lua.
-rw-r--r-- | luatexbase-loader.dtx | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index c3eb1f6..cfbe600 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -298,17 +298,31 @@ module('luatexbase', package.seeall) % Emulate (approximatively) kpse's lua format search. % % \begin{macrocode} -local lua_suffixes = { - "", - ".luc", ".luctex", ".texluc", - ".lua", ".luatex", ".texlua", +local lua_search_suffixes = { + ".luc", ".lua", "", ".luctex", ".texluc", + ".luatex", ".texlua", +} +local lua_valid_suffixes = { + luc = true, + lua = true, + luctex = true, + texluc = true, + luatex = true, + texlua = true, } local function find_file_lua_emul(name) - for _, suf in ipairs(lua_suffixes) do + for _, suf in ipairs(lua_search_suffixes) do local name = name..suf local f = kpse.find_file(name, 'texmfscripts') or kpse.find_file(name, 'tex') - if f then return f end + if suffix == "" and f then + local ext = string.match(f,"^.+%.([^/\\]-)$") + if lua_valid_suffixes then + return f + end + elseif f then + return f + end end end % \end{macrocode} |