projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4bc6b85
)
libs/nixio: allow calls to nixio.util.consume() with no iterator given
author
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 18 Jul 2009 21:58:41 +0000
(21:58 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 18 Jul 2009 21:58:41 +0000
(21:58 +0000)
libs/nixio/lua/nixio/util.lua
patch
|
blob
|
history
diff --git
a/libs/nixio/lua/nixio/util.lua
b/libs/nixio/lua/nixio/util.lua
index d83209aff63edad2b6128e79d9e7b1b8f703dbdc..ecefb4c97f0ca606665c43cb6ffb97df8462ecb0 100644
(file)
--- a/
libs/nixio/lua/nixio/util.lua
+++ b/
libs/nixio/lua/nixio/util.lua
@@
-28,8
+28,10
@@
local ZBUG = uname.sysname == "Linux" and uname.release:sub(1, 3) == "2.4"
function consume(iter, append)
local tbl = append or {}
- for obj in iter do
- tbl[#tbl+1] = obj
+ if iter then
+ for obj in iter do
+ tbl[#tbl+1] = obj
+ end
end
return tbl
end