Merge 0.9->0.10
[prosody.git] / util / pluginloader.lua
index c10fdf6525ae2e34868a5bf8bf90c3104664d920..b9b3e207fa685ffbf38dbc4f474567fd7a81f6a8 100644 (file)
@@ -1,7 +1,7 @@
 -- Prosody IM
 -- Copyright (C) 2008-2010 Matthew Wild
 -- Copyright (C) 2008-2010 Waqas Hussain
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
@@ -39,10 +39,10 @@ function load_resource(plugin, resource)
        resource = resource or "mod_"..plugin..".lua";
 
        local names = {
-               "mod_"..plugin.."/"..plugin.."/"..resource; -- mod_hello/hello/mod_hello.lua
-               "mod_"..plugin.."/"..resource;              -- mod_hello/mod_hello.lua
-               plugin.."/"..resource;                      -- hello/mod_hello.lua
-               resource;                                   -- mod_hello.lua
+               "mod_"..plugin..dir_sep..plugin..dir_sep..resource; -- mod_hello/hello/mod_hello.lua
+               "mod_"..plugin..dir_sep..resource;                  -- mod_hello/mod_hello.lua
+               plugin..dir_sep..resource;                          -- hello/mod_hello.lua
+               resource;                                           -- mod_hello.lua
        };
 
        return load_file(names);