From 7c8feab610fd956780c05700aac6d5d0b566da6d Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 25 Sep 2012 19:48:26 -0300 Subject: Fix map_trees when fn does not return values. --- src/luarocks/path.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 function map_trees(use_trees, fn, ...) local result = {} if use_trees == "one" then - table.insert(result, fn(cfg.root_dir, ...)) + table.insert(result, (fn(cfg.root_dir, ...)) or 0) elseif use_trees == "all" or use_trees == "order" then local use = false if use_trees == "all" then @@ -320,7 +320,7 @@ function map_trees(use_trees, fn, ...) use = true end if use then - table.insert(result, fn(tree, ...)) + table.insert(result, (fn(tree, ...)) or 0) end end end -- cgit v1.2.3-55-g6feb