diff --git a/lib/zip/filesystem.rb b/lib/zip/filesystem.rb index 692017ef..81ad1a18 100644 --- a/lib/zip/filesystem.rb +++ b/lib/zip/filesystem.rb @@ -573,8 +573,8 @@ def get_output_stream(fileName, permissionInt = nil, &aProc) @zipFile.get_output_stream(expand_to_entry(fileName), permissionInt, &aProc) end - def glob(*args, &block) - @zipFile.glob(*args, &block) + def glob(pattern, *flags, &block) + @zipFile.glob(expand_to_entry(pattern), *flags, &block) end def read(fileName) diff --git a/test/filesystem/directory_test.rb b/test/filesystem/directory_test.rb index f20a6dc1..f36ede53 100644 --- a/test/filesystem/directory_test.rb +++ b/test/filesystem/directory_test.rb @@ -109,6 +109,11 @@ def test_glob zf.dir.glob('globTest/foo/**/*.txt') do |f| assert_equal globbed_files[0], f.name end + + zf.dir.chdir('globTest/foo') + zf.dir.glob('**/*.txt') do |f| + assert_equal globbed_files[0], f.name + end end end