awful.util: change table.clone to do deep copies

Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Lukas Hrazky 2009-10-24 14:51:47 +02:00 committed by Julien Danjou
parent c09582dca3
commit a079ab654d
1 changed files with 5 additions and 1 deletions

View File

@ -339,7 +339,11 @@ end
function table.clone(t)
local c = { }
for k, v in pairs(t) do
c[k] = v
if type(v) == "table" then
c[k] = table.clone(v)
else
c[k] = v
end
end
return c
end