X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftar.c;h=08f334f554f50f0376576baaf51aa2199549f9de;hb=8e10d93d01049d4c5c58ebe57da499a3873be9db;hp=85248091b98b149743d76406805baf6093f8ca28;hpb=46da9968df4bad8ce3899f98000aa5612375d29f;p=chaz%2Ftar diff --git a/src/tar.c b/src/tar.c index 8524809..08f334f 100644 --- a/src/tar.c +++ b/src/tar.c @@ -167,6 +167,14 @@ set_archive_format (char const *name) archive_format = p->fmt; } +static void +set_xattr_option (int value) +{ + if (value == 1) + set_archive_format ("posix"); + xattrs_option = value; +} + const char * archive_format_string (enum archive_format fmt) { @@ -2095,16 +2103,16 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case XATTR_OPTION: - set_archive_format ("posix"); - xattrs_option = 1; + set_xattr_option (1); break; case NO_XATTR_OPTION: - xattrs_option = -1; + set_xattr_option (-1); break; case XATTR_INCLUDE: case XATTR_EXCLUDE: + set_xattr_option (1); xattrs_mask_add (arg, (key == XATTR_INCLUDE)); break;