diff options
author | kientzle <kientzle@FreeBSD.org> | 2010-02-07 02:00:26 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2010-02-07 02:00:26 +0000 |
commit | a405ab8bd4b54c290a83c59ee78dfd001568834d (patch) | |
tree | 9c540137fcbc6850f0fd47cab1694094ae3b6824 /usr.bin/tar/bsdtar.c | |
parent | e3debd74cb13f99f183614845c9e80b401a4939a (diff) | |
download | FreeBSD-src-a405ab8bd4b54c290a83c59ee78dfd001568834d.zip FreeBSD-src-a405ab8bd4b54c290a83c59ee78dfd001568834d.tar.gz |
Merge a bunch of refactoring from Joerg Sonnenberger to
isolate common code used by tar and cpio (and useful to other
libarchive clients). The functions here are prefixed with
"lafe" (libarchive front-end) to indicate their use.
Diffstat (limited to 'usr.bin/tar/bsdtar.c')
-rw-r--r-- | usr.bin/tar/bsdtar.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c index 0c4640e..c858ba3 100644 --- a/usr.bin/tar/bsdtar.c +++ b/usr.bin/tar/bsdtar.c @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "bsdtar.h" #include "err.h" +#include "matching.h" /* * Per POSIX.1-1988, tar defaults to reading/writing archives to/from @@ -248,7 +249,7 @@ main(int argc, char **argv) bsdtar->option_chroot = 1; break; case OPTION_EXCLUDE: /* GNU tar */ - if (exclude(bsdtar, bsdtar->optarg)) + if (lafe_exclude(&bsdtar->matching, bsdtar->optarg)) bsdtar_errc(1, 0, "Couldn't exclude %s\n", bsdtar->optarg); break; @@ -294,7 +295,7 @@ main(int argc, char **argv) * noone else needs this to filter entries * when transforming archives. */ - if (include(bsdtar, bsdtar->optarg)) + if (lafe_include(&bsdtar->matching, bsdtar->optarg)) bsdtar_errc(1, 0, "Failed to add %s to inclusion list", bsdtar->optarg); @@ -484,7 +485,7 @@ main(int argc, char **argv) bsdtar->option_interactive = 1; break; case 'X': /* GNU tar */ - if (exclude_from_file(bsdtar, bsdtar->optarg)) + if (lafe_exclude_from_file(&bsdtar->matching, bsdtar->optarg)) bsdtar_errc(1, 0, "failed to process exclusions from file %s", bsdtar->optarg); @@ -607,7 +608,7 @@ main(int argc, char **argv) break; } - cleanup_exclusions(bsdtar); + lafe_cleanup_exclusions(&bsdtar->matching); #if HAVE_REGEX_H cleanup_substitution(bsdtar); #endif |