Software / code / prosody
Comparison
core/configmanager.lua @ 2974:f37dc6f038f3
configmanager: Fix some wacky indentation
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 04 May 2010 23:07:49 +0100 |
| parent | 2925:692b3c6c5bd2 |
| child | 2975:c1a2e210f47e |
comparison
equal
deleted
inserted
replaced
| 2973:61e103d99578 | 2974:f37dc6f038f3 |
|---|---|
| 28 local host_mt = { __index = global_config }; | 28 local host_mt = { __index = global_config }; |
| 29 | 29 |
| 30 -- When key not found in section, check key in global's section | 30 -- When key not found in section, check key in global's section |
| 31 function section_mt(section_name) | 31 function section_mt(section_name) |
| 32 return { __index = function (t, k) | 32 return { __index = function (t, k) |
| 33 local section = rawget(global_config, section_name); | 33 local section = rawget(global_config, section_name); |
| 34 if not section then return nil; end | 34 if not section then return nil; end |
| 35 return section[k]; | 35 return section[k]; |
| 36 end }; | 36 end |
| 37 }; | |
| 37 end | 38 end |
| 38 | 39 |
| 39 function getconfig() | 40 function getconfig() |
| 40 return config; | 41 return config; |
| 41 end | 42 end |