awful.util: table.join ignore nil arguments

Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
koniu 2009-04-18 22:22:15 +01:00 committed by Julien Danjou
parent b9ca6b4961
commit 37071c5f6f
1 changed files with 7 additions and 5 deletions

View File

@ -224,11 +224,13 @@ end
function table.join(...) function table.join(...)
local ret = {} local ret = {}
for i = 1, arg.n do for i = 1, arg.n do
for k, v in pairs(arg[i]) do if arg[i] then
if type(k) == "number" then for k, v in pairs(arg[i]) do
rtable.insert(ret, v) if type(k) == "number" then
else rtable.insert(ret, v)
ret[k] = v else
ret[k] = v
end
end end
end end
end end