util.serialization: Correctly serialize tables with 'false' as a key, fixes an issue with rosters not saving (thanks mathias, Tobias) 0.6.1

Wed, 25 Nov 2009 23:45:45 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 25 Nov 2009 23:45:45 +0000
changeset 2222
81b4e738e4d3
parent 2216
9e1c6b6a2ee4
child 2223
458da843020f
child 2225
900df4782784

util.serialization: Correctly serialize tables with 'false' as a key, fixes an issue with rosters not saving (thanks mathias, Tobias)

util/serialization.lua file | annotate | diff | comparison | revisions
--- a/util/serialization.lua	Wed Nov 25 19:58:19 2009 +0000
+++ b/util/serialization.lua	Wed Nov 25 23:45:45 2009 +0000
@@ -35,7 +35,7 @@
 	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));

mercurial