Made getMatchingPrograms more accurate

This commit is contained in:
Łukasz Magiera 2014-08-05 00:22:02 +02:00
parent 4f91f00b55
commit f39b501b1a

View File

@ -160,7 +160,7 @@ local function getMatchingPrograms(pattern)
local res = {}
for dir in string.gmatch(os.getenv("PATH"), "[a-zA-Z0-9/.]+") do
for file in fs.list(dir) do
if string.match("/" .. file, "/" .. pattern) and file:match("(.+)[.]lua") then
if string.match(file, "^" .. pattern .. "(.+)[.]lua") then
res[#res+1] = file:match("(.+).lua")
end
end