aboutsummaryrefslogtreecommitdiffstats
path: root/util/datamanager.lua
diff options
context:
space:
mode:
authorJames Callahan <james@chatid.com>2011-12-12 17:08:48 +1100
committerJames Callahan <james@chatid.com>2011-12-12 17:08:48 +1100
commitb1a0c2c1a8bdfcb1ec2dc3e6a1c02dcfa838649c (patch)
tree34dd770da0fc1ccf5ee06b2cec271e364e59c75a /util/datamanager.lua
parentdcec3ba63923698c8292a371c128aaab680d18f9 (diff)
downloadprosody-b1a0c2c1a8bdfcb1ec2dc3e6a1c02dcfa838649c.tar.gz
prosody-b1a0c2c1a8bdfcb1ec2dc3e6a1c02dcfa838649c.zip
util/datamanager: Use package.config to figure out directory seperator
Diffstat (limited to 'util/datamanager.lua')
-rw-r--r--util/datamanager.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index d5e9c88c..a5d676cc 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -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.
--
@@ -20,7 +20,7 @@ local error = error;
local next = next;
local t_insert = table.insert;
local append = require "util.serialization".append;
-local path_separator = "/"; if os.getenv("WINDIR") then path_separator = "\\" end
+local path_separator = assert ( package.config:match ( "^([^\n]+)" ) , "package.config not in standard form" ) -- Extract directory seperator from package.config (an undocumented string that comes with lua)
local lfs = require "lfs";
local prosody = prosody;
local raw_mkdir;
@@ -72,7 +72,7 @@ local function callback(username, host, datastore, data)
username, host, datastore, data = f(username, host, datastore, data);
if username == false then break; end
end
-
+
return username, host, datastore, data;
end
function add_callback(func)