tools/migration/migrator/prosody_files.lua: Fix for previous commit
authorMatthew Wild <mwild1@gmail.com>
Tue, 5 Apr 2011 13:34:48 +0000 (14:34 +0100)
committerMatthew Wild <mwild1@gmail.com>
Tue, 5 Apr 2011 13:34:48 +0000 (14:34 +0100)
tools/migration/migrator/prosody_files.lua

index fe48e7a41d1efb0443fbcd09662b1c39c53decfd..4e42f564a2d7416fff52897e0e30d5c3a53b14c8 100644 (file)
@@ -13,6 +13,7 @@ local mtools = require "migrator.mtools";
 local next = next;
 local pairs = pairs;
 local json = require "util.json";
+local os_getenv = os.getenv;
 
 prosody = {};
 local dm = require "util.datamanager"
@@ -22,7 +23,7 @@ module "prosody_files"
 local function is_dir(path) return lfs.attributes(path, "mode") == "directory"; end
 local function is_file(path) return lfs.attributes(path, "mode") == "file"; end
 local function clean_path(path)
-       return path:gsub("\\", "/"):gsub("//+", "/"):gsub("^~", os.getenv("HOME") or "~");
+       return path:gsub("\\", "/"):gsub("//+", "/"):gsub("^~", os_getenv("HOME") or "~");
 end
 local encode, decode; do
        local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end });