Software /
code /
prosody
Comparison
tools/migration/migrator/jabberd14.lua @ 4445:0434eb77d18c
migrator/jabberd14: Minor refactoring.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 09 Dec 2011 11:37:30 +0500 |
parent | 4417:33c149394dcb |
child | 5218:8350eaa3f3f3 |
comparison
equal
deleted
inserted
replaced
4444:498eaeff6a05 | 4445:0434eb77d18c |
---|---|
65 end | 65 end |
66 end; | 66 end; |
67 end)(); | 67 end)(); |
68 | 68 |
69 local function load_xml(path) | 69 local function load_xml(path) |
70 if path then | 70 local f, err = io_open(path); |
71 local f, err = io_open(path); | 71 if not f then return f, err; end |
72 if not f then return f, err; end | 72 local data = f:read("*a"); |
73 local data = f:read("*a"); | 73 f:close(); |
74 f:close(); | 74 if not data then return; end |
75 if data then | 75 return parse_xml(data); |
76 return parse_xml(data); | |
77 end | |
78 end | |
79 end | 76 end |
80 | 77 |
81 local function load_spool_file(host, filename, path) | 78 local function load_spool_file(host, filename, path) |
82 local xml = load_xml(path); | 79 local xml = load_xml(path); |
83 if not xml then return; end | 80 if not xml then return; end |