]> Dogcows Code - chaz/tar/commitdiff
(extract_archive): Use sparse_member_p instead of GNUTYPE_SPARSE.
authorSergey Poznyakoff <gray@gnu.org.ua>
Sun, 4 Apr 2004 09:26:11 +0000 (09:26 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Sun, 4 Apr 2004 09:26:11 +0000 (09:26 +0000)
src/extract.c

index ec483050aae2cc495b6a10b615c33bcb091fa3d7..0feb68c345aa7d2ac49b56f252366894f79670c3 100644 (file)
@@ -510,6 +510,9 @@ maybe_recoverable (char *file_name, int *interdir_made)
            errno = EEXIST;
            return r;
          }
+
+       case UNLINK_FIRST_OLD_FILES:
+         break;
        }
 
     case ENOENT:
@@ -596,7 +599,6 @@ extract_archive (void)
   int openflag;
   mode_t mode;
   off_t size;
-  off_t file_size;
   int interdir_made = 0;
   char typeflag;
   char *file_name;
@@ -643,11 +645,9 @@ extract_archive (void)
 
   /* Extract the archive entry according to its type.  */
 
-  typeflag = current_header->header.typeflag;
-  /*KLUDGE */
-  if (current_format == POSIX_FORMAT
-      && current_stat_info.archive_file_size != current_stat_info.stat.st_size)
-         typeflag = GNUTYPE_SPARSE;
+  /* KLUDGE */
+  typeflag = sparse_member_p (&current_stat_info) ?
+                  GNUTYPE_SPARSE : current_header->header.typeflag;
   
   switch (typeflag)
     {
@@ -724,7 +724,7 @@ extract_archive (void)
        }
 
     extract_file:
-      if (typeflag == GNUTYPE_SPARSE)
+      if (current_stat_info.is_sparse)
        {
          sparse_extract_file (fd, &current_stat_info, &size);
        }
This page took 0.030924 seconds and 4 git commands to generate.