util.serialization: Correctly serialize tables with 'false' as a key, fixes an issue...
authorMatthew Wild <mwild1@gmail.com>
Wed, 25 Nov 2009 23:45:45 +0000 (23:45 +0000)
committerMatthew Wild <mwild1@gmail.com>
Wed, 25 Nov 2009 23:45:45 +0000 (23:45 +0000)
util/serialization.lua

index 07a099c910533cc1c95df93fc19fcb7a679dfda6..7071d3f75e03f4af116919ff53f29fbf9b1578f6 100644 (file)
@@ -35,7 +35,7 @@ local function _simplesave(o, ind, t, func)
        elseif type(o) == "string" then
                func(t, (("%q"):format(o):gsub("\\\n", "\\n")));
        elseif type(o) == "table" then
-               if next(o) then
+               if next(o) ~= nil then
                        func(t, "{\n");
                        for k,v in pairs(o) do
                                func(t, indent(ind));