From f33b657ef4ff9cd6dedbceefced8d9c7bf76cd0b Mon Sep 17 00:00:00 2001
From: Waqas Hussain <waqas20@gmail.com>
Date: Thu, 11 Feb 2010 05:36:03 +0500
Subject: modulemanager: Load plugin libraries in the same environment as the
 plugins.

---
 core/modulemanager.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 37c5e382..6b2260f5 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -398,7 +398,7 @@ function api:require(lib)
 		f, n = pluginloader.load_code(lib, lib..".lib.lua");
 	end
 	if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message
-	setfenv(f, setmetatable({ module = self }, { __index = _G }));
+	setfenv(f, self.environment);
 	return f();
 end
 
-- 
cgit v1.2.3