From 29571234614ef11c8b2ff57588c4b5774fe3c55f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= <mpg@elzevir.fr>
Date: Sun, 28 Mar 2010 19:08:46 +0200
Subject: require(foo.bar) looks for foo/bar.lua

---
 luatexbase-loader.dtx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'luatexbase-loader.dtx')

diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx
index 684fcab..a6fa7e7 100644
--- a/luatexbase-loader.dtx
+++ b/luatexbase-loader.dtx
@@ -245,8 +245,15 @@ module('luatexbase', package.seeall)
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+local function find_module_file(mod)
+  return kpse.find_file(mod:gsub('%.', '/'), 'lua')
+    or kpse.find_file(mod, 'lua')
+end
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 local function load_module(mod)
-  local file = kpse.find_file(mod, 'lua')
+  local file = find_module_file(file)
   if not file then
     return "\n\t[luatexbase.loader] Search failed"
   end
-- 
cgit v1.2.3

