Mercurial > prosody-hg
comparison core/configmanager.lua @ 5125:cdbc86b69ea2
Merge 0.9->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 13 Sep 2012 18:32:24 +0100 |
| parents | a4a74a0e9b9c |
| children | ac530c44772e |
comparison
equal
deleted
inserted
replaced
| 5123:7c5c86fa552e | 5125:cdbc86b69ea2 |
|---|---|
| 245 if f:sub(1,1) ~= "." and f:match(patt) then | 245 if f:sub(1,1) ~= "." and f:match(patt) then |
| 246 env.Include(path..path_sep..f); | 246 env.Include(path..path_sep..f); |
| 247 end | 247 end |
| 248 end | 248 end |
| 249 else | 249 else |
| 250 local file = resolve_relative_path(config_file:gsub("[^"..path_sep.."]+$", ""), file); | |
| 250 local f, err = io.open(file); | 251 local f, err = io.open(file); |
| 251 if f then | 252 if f then |
| 252 local data = f:read("*a"); | 253 local ret, err = parsers.lua.load(f:read("*a"), file, config); |
| 253 local file = resolve_relative_path(config_file:gsub("[^"..path_sep.."]+$", ""), file); | |
| 254 local ret, err = parsers.lua.load(data, file, config); | |
| 255 if not ret then error(err:gsub("%[string.-%]", file), 0); end | 254 if not ret then error(err:gsub("%[string.-%]", file), 0); end |
| 256 end | 255 end |
| 257 if not f then error("Error loading included "..file..": "..err, 0); end | 256 if not f then error("Error loading included "..file..": "..err, 0); end |
| 258 return f, err; | 257 return f, err; |
| 259 end | 258 end |
