Skip to content

Commit

Permalink
Fix crash on passing false as value in table to table.copy(t)
Browse files Browse the repository at this point in the history
Fixes #2293.
  • Loading branch information
est31 authored and Zeno- committed Feb 14, 2015
1 parent d44cb54 commit 7c5accf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions builtin/common/misc_helpers.lua
Expand Up @@ -545,12 +545,11 @@ function table.copy(t, seen)
seen = seen or {}
seen[t] = n
for k, v in pairs(t) do
n[type(k) ~= "table" and k or seen[k] or table.copy(k, seen)] =
type(v) ~= "table" and v or seen[v] or table.copy(v, seen)
n[(type(k) == "table" and (seen[k] or table.copy(k, seen))) or k] =
(type(v) == "table" and (seen[v] or table.copy(v, seen))) or v
end
return n
end

--------------------------------------------------------------------------------
-- mainmenu only functions
--------------------------------------------------------------------------------
Expand Down

0 comments on commit 7c5accf

Please sign in to comment.