From 9bf87b195e732d03db5efc8850ac5e29a2538df9 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 7 Dec 2006 14:33:42 +0000 Subject: [PATCH] (dump_dir0): Move checks for exclude tags to dump_file0. (dump_dir): Move calls to ensure_slash to dump_file0 --- src/create.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/create.c b/src/create.c index 641603a..23e9efd 100644 --- a/src/create.c +++ b/src/create.c @@ -1173,20 +1173,7 @@ dump_dir0 (char *directory, quotearg_colon (st->orig_file_name))); return; } - - if (exclude_caches_option - && check_cache_directory(st->orig_file_name)) - { - if (verbose_option) - WARN ((0, 0, - _("%s: contains a cache directory tag; not dumped"), - quotearg_colon (st->orig_file_name))); - return; - } - - if (check_exclude_tags (st->orig_file_name)) - return; - + { char const *entry; size_t entry_len; @@ -1237,9 +1224,6 @@ dump_dir (int fd, struct tar_stat_info *st, int top_level, dev_t parent_device) return false; } - ensure_slash (&st->orig_file_name); - ensure_slash (&st->file_name); - dump_dir0 (directory, st, top_level, parent_device); free (directory); @@ -1560,6 +1544,22 @@ dump_file0 (struct tar_stat_info *st, const char *p, if (is_dir) { + ensure_slash (&st->orig_file_name); + ensure_slash (&st->file_name); + + if (exclude_caches_option + && check_cache_directory (st->orig_file_name)) + { + if (verbose_option) + WARN ((0, 0, + _("%s: contains a cache directory tag; not dumped"), + quotearg_colon (st->orig_file_name))); + return; + } + + if (check_exclude_tags (st->orig_file_name)) + return; + ok = dump_dir (fd, st, top_level, parent_device); /* dump_dir consumes FD if successful. */ -- 2.44.0