Browse Source

(dump_dir0): Move checks for exclude tags to
dump_file0.
(dump_dir): Move calls to ensure_slash to dump_file0

Sergey Poznyakoff 18 years ago
parent
commit
9bf87b195e
1 changed files with 17 additions and 17 deletions
  1. 17 17
      src/create.c

+ 17 - 17
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.  */