From 6d0ff6d2f0366e2b8f6d5dc3b15ddb3abb57163a Mon Sep 17 00:00:00 2001 From: Aurélien Aptel Date: Tue, 16 Jul 2013 16:16:29 +0200 Subject: clitar.c: fix creation exclusion, don't reverse in exclusion mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Aptel Reviewed-by: David Disseldorp Reviewed-by: Andreas Schneider --- source3/client/clitar.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index c1195e9514b..d3d17d88417 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -352,7 +352,8 @@ static bool tar_create_skip_path(struct tar *t, const bool skip = true; const mode_t mode = finfo->mode; const bool isdir = mode & FILE_ATTRIBUTE_DIRECTORY; - bool in; + const bool exclude = t->mode.selection == TAR_EXCLUDE; + bool in = true; if (!isdir) { @@ -374,10 +375,12 @@ static bool tar_create_skip_path(struct tar *t, /* 3. is it in the selection list? */ - in = t->path_list_size > 0 ? tar_path_in_list(t, fullpath, isdir) : true; + if (t->path_list_size > 0) { + in = tar_path_in_list(t, fullpath, isdir && !exclude); + } /* inverse result if in exclude mode */ - if (t->mode.selection == TAR_EXCLUDE) { + if (exclude) { in = !in; } -- cgit