Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add --ignore-zeros option to bsdtar #61

merged 1 commit into from Mar 16, 2014


None yet
2 participants

kevinoid commented Jan 15, 2014

As suggested in #60, this pull request adds support for --ignore-zeros as an alias of --options read_concatenated_archive for compatibility with GNU tar.

The implementation adds an option_ignore_zeros member to struct bsdtar which isn't strictly necessary, since "read_concatenated_archive" could either overwrite or be appended to option_options. However, (perhaps this is due to my rustiness with C) this would seem to require option_options to either be dynamically allocated (in at least some cases - requiring cleanup) or have a static buffer set aside or for --ignore-zeros to be incompatible with --options, all of which seemed less preferable to me than the additional field in stuct bsdtar. But, if I'm overlooking something or you'd prefer it implemented another way, I'd be happy to rewrite it.


Add --ignore-zeros option to bsdtar
This option is an alias for --options read_concatenated_archive
introduced for compatibility with GNU tar.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

@kientzle kientzle commented on the diff Jan 16, 2014

@@ -63,6 +63,7 @@ struct bsdtar {
char option_chroot; /* --chroot */
char option_fast_read; /* --fast-read */
const char *option_options; /* --options */

kientzle Jan 16, 2014


Yes, this should really be fixed. It should be possible, for instance, to specify --options more than once and get all the accumulated options. If we do that, we can implement --ignore-zeros the right way.

That might mean changing this to a linked list so we can add separate strings. It might be enough to make it a fixed array of 20 or 50 entries. But just one entry is clearly not enough.

kientzle added a commit that referenced this pull request Mar 16, 2014

Merge pull request #61 from kevinoid/ignore_zeros
Add --ignore-zeros option to bsdtar

@kientzle kientzle merged commit efb6bcb into libarchive:master Mar 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment