]> git.ipfire.org Git - thirdparty/tar.git/commit
Assume directory members have size=0. master
authorSergey Poznyakoff <gray@gnu.org>
Thu, 23 Jul 2026 07:42:56 +0000 (10:42 +0300)
committerSergey Poznyakoff <gray@gnu.org>
Thu, 23 Jul 2026 07:52:03 +0000 (10:52 +0300)
commit19a3a73e8c48bd3c59cbea9b5ed6780fc6836c6d
tree7347297669d7c797d3570d28fef1eb5b07297f18
parent5a225f25c5f414aaebe2f9fa5572f2cdfb7e1177
Assume directory members have size=0.

Since commit b8d8a61b, tar started honoring size field in headers
of the directory archive members when listing and extracting. That
doesn't seem right: although GNU tar always stores 0 for such members,
there are other tar implementation that don't. As a result, GNU tar
skips the actual directory contents when listing or extracting archives
created by such implementations.

This commit fixes that by assuming that size is 0 for directory archive
members.

* src/list.c (member_is_dir): Restore function.
(skim_member): Don't apply skim_file to directory members.
* tests/skipdir.at: Fix expectations.
src/list.c
tests/skipdir.at