diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-20 20:48:49 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 15:51:35 -0300 |
| commit | a1715807478ba5c2c16f8cf73eaf5f664aabdbcb (patch) | |
| tree | eabccaa19e28ff63ee022b00f12bfe1b2678ea9d /src | |
| parent | 7a2dd65869977c9f7f87ec2587faa7acc96fed2b (diff) | |
| download | luarocks-a1715807478ba5c2c16f8cf73eaf5f664aabdbcb.tar.gz luarocks-a1715807478ba5c2c16f8cf73eaf5f664aabdbcb.tar.bz2 luarocks-a1715807478ba5c2c16f8cf73eaf5f664aabdbcb.zip | |
config: be more resilient when reading config files
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/cmd/config.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/luarocks/cmd/config.lua b/src/luarocks/cmd/config.lua index 2a49c1db..12396630 100644 --- a/src/luarocks/cmd/config.lua +++ b/src/luarocks/cmd/config.lua | |||
| @@ -68,6 +68,7 @@ local cfg_skip = { | |||
| 68 | 68 | ||
| 69 | local function print_config(cfg) | 69 | local function print_config(cfg) |
| 70 | for k, v in util.sortedpairs(cfg) do | 70 | for k, v in util.sortedpairs(cfg) do |
| 71 | k = tostring(k) | ||
| 71 | if type(v) == "string" or type(v) == "boolean" or type(v) == "number" then | 72 | if type(v) == "string" or type(v) == "boolean" or type(v) == "number" then |
| 72 | printf("%s = %q", k, v) | 73 | printf("%s = %q", k, v) |
| 73 | elseif type(v) == "function" or cfg_skip[k] then | 74 | elseif type(v) == "function" or cfg_skip[k] then |
| @@ -109,8 +110,6 @@ local function print_config(cfg) | |||
| 109 | end | 110 | end |
| 110 | printf("}") | 111 | printf("}") |
| 111 | end | 112 | end |
| 112 | else | ||
| 113 | error(k) | ||
| 114 | end | 113 | end |
| 115 | end | 114 | end |
| 116 | end | 115 | end |
