Bug 3035545: The pattern { "./folder/*.c" } matches no files
This commit is contained in:
parent
781f1cf792
commit
c51666fc07
@ -21,6 +21,7 @@
|
||||
* Patch 3063804: Set CompileAs flag for VS200x C projects (rjmyst3)
|
||||
* Implemented StaticRuntime flag for Xcode (William Burnson)
|
||||
* Improved portability of Mac OS X binaries (William Burnson)
|
||||
* Bug 3035545: The pattern { "./folder/*.c" } matches no files
|
||||
|
||||
|
||||
-------
|
||||
|
@ -81,6 +81,13 @@
|
||||
--
|
||||
|
||||
local function domatch(result, mask, wantfiles)
|
||||
-- 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(3)
|
||||
end
|
||||
|
||||
-- strip off any leading directory information to find out
|
||||
-- where the search should take place
|
||||
local basedir = mask
|
||||
@ -91,13 +98,6 @@
|
||||
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(3)
|
||||
end
|
||||
|
||||
-- recurse into subdirectories?
|
||||
local recurse = mask:find("**", nil, true)
|
||||
|
||||
|
@ -73,6 +73,11 @@
|
||||
test.istrue(table.contains(result, "folder/ok.lua"))
|
||||
test.isfalse(table.contains(result, "folder/ok.lua.2"))
|
||||
end
|
||||
|
||||
function suite.matchfiles_OnLeadingDotSlashWithPath()
|
||||
local result = os.matchfiles("./folder/*.lua")
|
||||
test.istrue(table.contains(result, "folder/ok.lua"))
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user