ejabberd2prosody.lua: Don't make assumptions about file name.
authorKim Alvefur <zash@zash.se>
Thu, 24 Jan 2013 23:36:17 +0000 (00:36 +0100)
committerKim Alvefur <zash@zash.se>
Thu, 24 Jan 2013 23:36:17 +0000 (00:36 +0100)
tools/ejabberd2prosody.lua

index ee9e782101e439d74537244e7f8fc37df40bada3..c11e41d9e602676fba2f935600ad2b71f4b917ba 100755 (executable)
@@ -11,8 +11,8 @@
 
 package.path = package.path ..";../?.lua";
 
-if arg[0]:match("^./") then
-       package.path = package.path .. ";"..arg[0]:gsub("/ejabberd2prosody.lua$", "/?.lua");
+if arg[0]:match("[/\\]") then
+       package.path = package.path .. ";"..arg[0]:gsub("[^/\\]*$", "?.lua");
 end
 
 local erlparse = require "erlparse";