From 37823d6e677ae4048a9f6e6fc69d49cb2c9b53ad Mon Sep 17 00:00:00 2001
From: Elie Roux <elie.roux@telecom-bretagne.eu>
Date: Fri, 12 Apr 2013 09:34:58 +0200
Subject: Adapting to Lua 5.2 a better way

---
 luatexbase-loader.dtx | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

(limited to 'luatexbase-loader.dtx')

diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx
index 92e97b2..b7d3a5f 100644
--- a/luatexbase-loader.dtx
+++ b/luatexbase-loader.dtx
@@ -379,11 +379,10 @@ end
 %
 %    \begin{macrocode}
 local package_loader_two
-if package.searchers then
-  package_loader_two = package.searchers[2]
-else
-  package_loader_two = package.loaders[2]
+if not package.searchers then
+  package.searchers = package.loaders
 end
+package_loader_two = package.searchers[2]
 local function load_module(mod)
   local file = find_module_file(mod)
   if not file then
@@ -409,11 +408,7 @@ end
 %    Finally install this combined loader as loader 2.
 %
 %    \begin{macrocode}
-if package.searchers then
-  package.searchers[2] = load_module
-else
-  package.loaders[2] = load_module
-end
+package.searchers[2] = load_module
 %</luamodule>
 %    \end{macrocode}
 %
-- 
cgit v1.2.3

