From 908e4ba7f0d09fafb35272e021605404261f4432 Mon Sep 17 00:00:00 2001 From: mpeterv Date: Sat, 19 Dec 2015 19:22:37 +0300 Subject: Fix extension splitting in builting backend Fixes incorrect gcc command and error message when a file name doesn't contain a dot: Error: Build error: Failed compiling object .o becomes Error: Build error: Failed compiling object dotlessname --- src/luarocks/build/builtin.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index 00fd09ea..ffdc9450 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua @@ -202,7 +202,7 @@ function builtin.run(rockspec) for name, info in pairs(build.modules) do local moddir = path.module_to_path(name) if type(info) == "string" then - local ext = info:match(".([^.]+)$") + local ext = info:match("%.([^.]+)$") if ext == "lua" then local filename = dir.base_name(info) if info:match("init%.lua$") and not name:match("%.init$") then @@ -226,7 +226,7 @@ function builtin.run(rockspec) if info[1] then sources = info end if type(sources) == "string" then sources = {sources} end for _, source in ipairs(sources) do - local object = source:gsub(".[^.]*$", "."..cfg.obj_extension) + local object = source:gsub("%.[^.]*$", "."..cfg.obj_extension) if not object then object = source.."."..cfg.obj_extension end -- cgit v1.2.3-55-g6feb