Merge 0.9->0.10
[prosody.git] / tools / ejabberdsql2prosody.lua
index 4372064386c37ba8d0494faf0fca6037fb3ff7b1..930d5a6b787dd4204ea0de476199525d4d9fb8ff 100644 (file)
@@ -2,7 +2,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.
 --
 prosody = {};
 
 package.path = package.path ..";../?.lua";
+
+local my_name = arg[0];
+if my_name:match("[/\\]") then
+       package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
+       package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
+end
+
+
 local serialize = require "util.serialization".serialize;
 local st = require "util.stanza";
 local parse_xml = require "util.xml".parse;