aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/core/util.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/luarocks/core/util.lua b/src/luarocks/core/util.lua
index daec9d05..5f5c0fe1 100644
--- a/src/luarocks/core/util.lua
+++ b/src/luarocks/core/util.lua
@@ -166,7 +166,11 @@ function util.cleanup_path(list, sep, lua_version)
166 for _, part in ipairs(parts) do 166 for _, part in ipairs(parts) do
167 part = part:gsub("//", "/") 167 part = part:gsub("//", "/")
168 if lua_version then 168 if lua_version then
169 part = part:gsub("/lua/[%d.]+/", "/lua/"..lua_version.."/") 169 part = part:gsub("/lua/([%d.]+)/", function(part_version)
170 if part_version:sub(1, #lua_version) ~= lua_version then
171 return "/lua/"..lua_version.."/"
172 end
173 end)
170 end 174 end
171 if not entries[part] then 175 if not entries[part] then
172 table.insert(final, part) 176 table.insert(final, part)