diff --git a/src/common.h b/src/common.h index c51ab11..54f6749 100644 --- a/src/common.h +++ b/src/common.h @@ -91,6 +91,11 @@ enum subcommand GLOBAL enum subcommand subcommand_option; +#define READ_LIKE_SUBCOMMAND \ + (subcommand_option == EXTRACT_SUBCOMMAND \ + || subcommand_option == DIFF_SUBCOMMAND \ + || subcommand_option == LIST_SUBCOMMAND) + /* Selected format for output archive. */ GLOBAL enum archive_format archive_format; diff --git a/src/tar.c b/src/tar.c index 8c4f656..ccce615 100644 --- a/src/tar.c +++ b/src/tar.c @@ -2527,9 +2527,7 @@ decode_options (int argc, char **argv) --gray */ if (args.pax_option && archive_format != POSIX_FORMAT - && (subcommand_option != EXTRACT_SUBCOMMAND - || subcommand_option != DIFF_SUBCOMMAND - || subcommand_option != LIST_SUBCOMMAND)) + && !READ_LIKE_SUBCOMMAND) USAGE_ERROR ((0, 0, _("--pax-option can be used only on POSIX archives"))); /* If ready to unlink hierarchies, so we are for simpler files. */