glib icon indicating copy to clipboard operation
glib copied to clipboard

'Loader.File.Find' not correctly matching wildcards for 'file.Find'

Open CaveeJohnson opened this issue 8 years ago • 1 comments

Example code from a packed addon:

file.Find("somedir/*_theme.lua", "LUA")

-- Result
{
    [1] = "revenge_element.lua",
    [2] = "depthhud_classic_element.lua",
    [3] = "depthhud_classic_theme.lua",
    [4] = "revenge_theme.lua",
}

will match as if the code were

file.Find("somedir/*.lua", "LUA")

Problem lies here https://github.com/notcake/glib/blob/master/lua/glib/loader/loader.lua#L41-L59

but is likely caused here https://github.com/notcake/glib/blob/master/lua/glib/loader/packfilesystem.lua#L36-L53

I would make a pull request but I am unfamiliar with your code style and do not want to dirty the codebase. Substituting * for .* and pattern matching the name should work.

Thanks!

CaveeJohnson avatar Aug 06 '17 10:08 CaveeJohnson

This library is deprecated and I recommend avoiding using it,

but you're free to make pull requests.

notcake avatar Aug 06 '17 22:08 notcake