Changeset

4180:cd3fb3393e13

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
parents 4179:aa07a381e5a6
children 4181:2f4496f46da2
files util/pluginloader.lua
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/util/pluginloader.lua	Sun Feb 20 19:16:56 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)