From a405ab8bd4b54c290a83c59ee78dfd001568834d Mon Sep 17 00:00:00 2001 From: kientzle Date: Sun, 7 Feb 2010 02:00:26 +0000 Subject: 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. --- usr.bin/tar/bsdtar.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.bin/tar/bsdtar.c') 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 -- cgit v1.1