Diff

util/pluginloader.lua @ 4149:3c1b153c2856

util.pluginloader: Return full file path from internal file loader on success, not just the name.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 20 Feb 2011 20:01:05 +0500
parent 4121:ea7e3f22f898
child 4150:2894ca33ec45
line wrap: on
line diff
--- a/util/pluginloader.lua	Sun Feb 20 19:21:44 2011 +0500
+++ b/util/pluginloader.lua	Sun Feb 20 20:01:05 2011 +0500
@@ -20,15 +20,16 @@
 module "pluginloader"
 
 local function load_file(name)
-	local file, err;
+	local file, err, path;
 	for i=1,#plugin_dir do
-		file, err = io_open(plugin_dir[i]..name);
+		path = plugin_dir[i]..name;
+		file, err = io_open(path);
 		if file then break; end
 	end
 	if not file then return file, err; end
 	local content = file:read("*a");
 	file:close();
-	return content, name;
+	return content, path;
 end
 
 function load_resource(plugin, resource, loader)