From 4db71836afb6542e5eefbdc861c9b645fe51bff1 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Wed, 3 Aug 2022 17:13:26 +0200 Subject: [PATCH] Clear default Lua require path (#1085) This is mainly done to avoid requiring from the current working directory of the editor. This also avoids requiring from system paths, as it was already the case for the native modules search path. --- data/core/start.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/start.lua b/data/core/start.lua index 53f7248c..5db22ffd 100644 --- a/data/core/start.lua +++ b/data/core/start.lua @@ -16,7 +16,7 @@ USERDIR = (system.get_file_info(EXEDIR .. '/user') and (EXEDIR .. '/user')) or ((os.getenv("XDG_CONFIG_HOME") and os.getenv("XDG_CONFIG_HOME") .. "/lite-xl")) or (HOME and (HOME .. '/.config/lite-xl')) -package.path = DATADIR .. '/?.lua;' .. package.path +package.path = DATADIR .. '/?.lua;' package.path = DATADIR .. '/?/init.lua;' .. package.path package.path = USERDIR .. '/?.lua;' .. package.path package.path = USERDIR .. '/?/init.lua;' .. package.path