The code says: if basename == "rockspec" then name = "rockspec" else name = basename:match("(.*)%.rockspec") if not name and not basename == "rockspec" then return nil, "Filename '"..filename.."' does not look like a rockspec." end end
The clause `not basename == "rockspec"` is parsed as `(not basename)=="rockspec"`, which is always false. The intention clearly is `not(basename == "rockspec")` or `basename ~= "rockspec`. However, that clause is useless since if it is true, the branch is never reached. Thus, the test can merely be `if not name`. ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ Luarocks-developers mailing list Luarocks-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/luarocks-developers