Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 743ede3

Browse files
committed
fs: Fix bug with ArchiveFS stat method
I think this is what @WeidiDeng intended from #354
1 parent c341cc0 commit 743ede3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ func (f ArchiveFS) Stat(name string) (fs.FileInfo, error) {
537537
return nil, err
538538
}
539539

540-
if (len(files) == 0 && files[0].NameInArchive == name) || found {
540+
// exactly one or exact file found, test name match to detect implicit dir name https://github.com/mholt/archiver/issues/340
541+
if (len(files) == 1 && files[0].NameInArchive == name) || found {
541542
return files[len(files)-1].FileInfo, nil
542543
}
543544

0 commit comments

Comments
 (0)