diff --git a/src/base/os.lua b/src/base/os.lua index 7c921a70..8f89bfe3 100644 --- a/src/base/os.lua +++ b/src/base/os.lua @@ -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) diff --git a/tests/base/test_os.lua b/tests/base/test_os.lua index 089871b9..0d67ea65 100644 --- a/tests/base/test_os.lua +++ b/tests/base/test_os.lua @@ -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