From 8728bd989c646d3e36ed68a0196a93dd21287dd5 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 11 Oct 2011 02:03:52 -0300 Subject: switch from pattern to plain string matching, to avoid surprises --- src/luarocks/fetch.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index 874dc33f..80ca4400 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua @@ -313,10 +313,9 @@ function fetch_sources(rockspec, extract, dest_dir) and #rockspec.source.pathname > 0 then if #cfg.only_sources_from == 0 then return nil, "Can't download "..rockspec.source.url.." -- download from remote servers disabled" - elseif not rockspec.source.pathname:match("^"..cfg.only_sources_from) then + elseif rockspec.source.pathname:find(cfg.only_sources_from, 1, true) ~= 1 then return nil, "Can't download "..rockspec.source.url.." -- only downloading from "..cfg.only_sources_from end end - return proto.get_sources(rockspec, extract, dest_dir) end -- cgit v1.2.3-55-g6feb