Import upstream version 1.26
[debian/tar] / src / incremen.c
index 628ff296dc13036c7d22f3271a19b700ca1c1991..b2ab5bf0557e6331e9a612e010e5410cabe0dfdb 100644 (file)
@@ -426,7 +426,6 @@ procdir (const char *name_buffer, struct tar_stat_info *st,
 {
   struct directory *directory;
   struct stat *stat_data = &st->stat;
-  dev_t device = st->parent ? st->parent->stat.st_dev : 0;
   bool nfs = NFS_FILE_STAT (*stat_data);
 
   if ((directory = find_directory (name_buffer)) != NULL)
@@ -540,11 +539,8 @@ procdir (const char *name_buffer, struct tar_stat_info *st,
        }
     }
 
-  /* If the directory is on another device and --one-file-system was given,
-     omit it... */
-  if (one_file_system_option && device != stat_data->st_dev
-      /* ... except if it was explicitely given in the command line */
-      && !is_individual_file (name_buffer))
+  if (one_file_system_option && st->parent
+      && stat_data->st_dev != st->parent->stat.st_dev)
     /* FIXME:
        WARNOPT (WARN_XDEV,
                 (0, 0,
@@ -783,8 +779,7 @@ scan_directory (struct tar_stat_info *st)
 
   namebuf_free (nbuf);
 
-  if (dirp)
-    free (dirp);
+  free (dirp);
 
   return directory;
 }
@@ -1352,8 +1347,7 @@ read_directory_file (void)
 
   if (ferror (listed_incremental_stream))
     read_error (listed_incremental_option);
-  if (buf)
-    free (buf);
+  free (buf);
 }
 
 /* Output incremental data for the directory ENTRY to the file DATA.
@@ -1664,8 +1658,7 @@ try_purge_directory (char const *directory_name)
     {
       const char *entry;
       struct stat st;
-      if (p)
-       free (p);
+      free (p);
       p = new_name (directory_name, cur);
 
       if (deref_stat (p, &st) != 0)