diff options
author | Tim Kientzle <kientzle@FreeBSD.org> | 2004-07-25 04:15:50 +0000 |
---|---|---|
committer | Tim Kientzle <kientzle@FreeBSD.org> | 2004-07-25 04:15:50 +0000 |
commit | 4f23b47afa667972f8809ddd21fe1fb09e14001b (patch) | |
tree | 84cfc1bbe14c0ef5f72491304366c2674dc278d9 /usr.bin/tar/bsdtar.c | |
parent | 6c1c7ea2e46ec842bc6e8528417aff41beed5723 (diff) |
Notes
Diffstat (limited to 'usr.bin/tar/bsdtar.c')
-rw-r--r-- | usr.bin/tar/bsdtar.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c index c35fa78cac0ca..89dc5ad174434 100644 --- a/usr.bin/tar/bsdtar.c +++ b/usr.bin/tar/bsdtar.c @@ -225,7 +225,9 @@ main(int argc, char **argv) mode = opt; break; case OPTION_EXCLUDE: /* GNU tar */ - exclude(bsdtar, optarg); + if (exclude(bsdtar, optarg)) + bsdtar_errc(bsdtar, 1, 0, + "Couldn't exclude %s\n", optarg); break; case 'F': bsdtar->create_format = optarg; @@ -251,7 +253,10 @@ main(int argc, char **argv) exit(0); break; case OPTION_INCLUDE: - include(bsdtar, optarg); + if (include(bsdtar, optarg)) + bsdtar_errc(bsdtar, 1, 0, + "Failed to add %s to inclusion list", + optarg); break; case 'j': /* GNU tar */ if (bsdtar->create_compression != '\0') @@ -354,7 +359,10 @@ main(int argc, char **argv) bsdtar->option_interactive = 1; break; case 'X': /* GNU tar */ - exclude_from_file(bsdtar, optarg); + if (exclude_from_file(bsdtar, optarg)) + bsdtar_errc(bsdtar, 1, 0, + "failed to process exclusions from file %s", + optarg); break; case 'x': /* SUSv2 */ if (mode != '\0') @@ -392,7 +400,7 @@ main(int argc, char **argv) /* * Sanity-check options. */ - if (mode == '\0' && possible_help_request) { + if ((mode == '\0') && possible_help_request) { long_help(bsdtar); exit(0); } @@ -658,7 +666,7 @@ bsdtar_getopt(struct bsdtar *bsdtar, const char *optstring, p = optarg; q = strchr(optarg, '='); if (q != NULL) { - option_length = q - p; + option_length = (size_t)(q - p); optarg = q + 1; } else { option_length = strlen(p); |