Fixed handling of ./ prefix on file wildcards

This commit is contained in:
starkos 2010-01-13 23:35:09 +00:00
parent deb345176a
commit ef21349505
2 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,7 @@
--
-- os.lua
-- Additions to the OS namespace.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
-- Copyright (c) 2002-2010 Jason Perkins and the Premake project
--
@ -91,6 +91,13 @@
basedir = path.getdirectory(basedir)
if (basedir == ".") then basedir = "" end
-- need to remove extraneous path info from the mask to ensure a match
-- against the paths returned by the OS. Haven't come up with a good
-- way to do it yet, so will handle cases as they come up
if mask:startswith("./") then
mask = mask:sub(2)
end
-- recurse into subdirectories?
local recurse = mask:find("**", nil, true)

View File

@ -64,10 +64,8 @@
end
function suite.matchfiles_OnDotSlashPrefix()
test.print("===============================")
local result = os.matchfiles("./**.lua")
test.istrue(table.contains(result, "folder/ok.lua"))
test.print("===============================")
end