diff options
author | cperciva <cperciva@FreeBSD.org> | 2006-12-23 07:06:37 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2006-12-23 07:06:37 +0000 |
commit | b13aff146b9a1bfbd4cd660285a608c75f4ee17e (patch) | |
tree | bfd0af70268f58d4e01c32e74c75e98f8a8d7025 /usr.bin | |
parent | a5fb73ad660808f6dc03aa03d8efbce50c5c3541 (diff) | |
download | FreeBSD-src-b13aff146b9a1bfbd4cd660285a608c75f4ee17e.zip FreeBSD-src-b13aff146b9a1bfbd4cd660285a608c75f4ee17e.tar.gz |
Add two checks for inappropriate options: -U only makes sense in "x"
mode, and --strip-components only makes sense in "x" and "t" modes.
MFC after: 3 days
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tar/bsdtar.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c index 0e0d437..a6e45e9 100644 --- a/usr.bin/tar/bsdtar.c +++ b/usr.bin/tar/bsdtar.c @@ -532,6 +532,8 @@ main(int argc, char **argv) only_mode(bsdtar, "-n", "cru"); if (bsdtar->option_stdout) only_mode(bsdtar, "-O", "xt"); + if (bsdtar->option_unlink_first) + only_mode(bsdtar, "-U" "x"); if (bsdtar->option_warn_links) only_mode(bsdtar, "--check-links", "cr"); @@ -552,6 +554,8 @@ main(int argc, char **argv) buff[1] = bsdtar->symlink_mode; only_mode(bsdtar, buff, "cru"); } + if (bsdtar->strip_components != 0) + only_mode(bsdtar, "--strip-components", "xt"); bsdtar->argc -= optind; bsdtar->argv += optind; |