# HG changeset patch
# User James Callahan <james@chatid.com>
# Date 1323670128 -39600
# Node ID 7de17ca4de14143e4f8997359c4f3ff43162ee3e
# Parent  70275ab52ab29c8fed0c943c5a6f3d3af8837d26
util/datamanager: Use package.config to figure out directory seperator

diff -r 70275ab52ab2 -r 7de17ca4de14 util/datamanager.lua
--- a/util/datamanager.lua	Sun Dec 11 17:08:34 2011 +0000
+++ b/util/datamanager.lua	Mon Dec 12 17:08:48 2011 +1100
@@ -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 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 @@
 		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)