aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-09-25 19:48:26 -0300
committerHisham Muhammad <hisham@gobolinux.org>2012-09-25 19:48:26 -0300
commit7c8feab610fd956780c05700aac6d5d0b566da6d (patch)
tree21f2df14e28e120b9f910e04ccf136dc6a42ba7b /src
parente5b5ce7cf3a9e0bb0731692f1839a4647d61ada6 (diff)
downloadluarocks-7c8feab610fd956780c05700aac6d5d0b566da6d.tar.gz
luarocks-7c8feab610fd956780c05700aac6d5d0b566da6d.tar.bz2
luarocks-7c8feab610fd956780c05700aac6d5d0b566da6d.zip
Fix map_trees when fn does not return values.
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/path.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua
index 17d9d52b..e613d112 100644
--- a/src/luarocks/path.lua
+++ b/src/luarocks/path.lua
@@ -309,7 +309,7 @@ end
309function map_trees(use_trees, fn, ...) 309function map_trees(use_trees, fn, ...)
310 local result = {} 310 local result = {}
311 if use_trees == "one" then 311 if use_trees == "one" then
312 table.insert(result, fn(cfg.root_dir, ...)) 312 table.insert(result, (fn(cfg.root_dir, ...)) or 0)
313 elseif use_trees == "all" or use_trees == "order" then 313 elseif use_trees == "all" or use_trees == "order" then
314 local use = false 314 local use = false
315 if use_trees == "all" then 315 if use_trees == "all" then
@@ -320,7 +320,7 @@ function map_trees(use_trees, fn, ...)
320 use = true 320 use = true
321 end 321 end
322 if use then 322 if use then
323 table.insert(result, fn(tree, ...)) 323 table.insert(result, (fn(tree, ...)) or 0)
324 end 324 end
325 end 325 end
326 end 326 end