]> Dogcows Code - chaz/tar/blobdiff - src/list.c
Assign orig_file_name
[chaz/tar] / src / list.c
index e0f5080876c623e25e11f945c4b06c606be2b0c0..16a6970a58f618c1c16aeb0c5ccd2d6b0757134c 100644 (file)
@@ -222,7 +222,7 @@ list_archive (void)
       set_next_block_after (current_header);
       if (multi_volume_option)
        {
-         assign_string (&save_name, current_stat_info.file_name);
+         assign_string (&save_name, current_stat_info.orig_file_name);
          save_totsize = current_stat_info.stat.st_size;
        }
       for (size = current_stat_info.stat.st_size; size > 0; size -= written)
@@ -258,7 +258,7 @@ list_archive (void)
     }
 
   if (multi_volume_option)
-    assign_string (&save_name, current_stat_info.file_name);
+    assign_string (&save_name, current_stat_info.orig_file_name);
 
   skip_member ();
 
@@ -465,11 +465,6 @@ read_header (bool raw_extended_headers)
                  np[sizeof h->prefix] = '\0';
                  np += strlen (np);
                  *np++ = '/';
-
-                 /* Prevent later references to current_header from
-                    mistakenly treating this as an old GNU header.
-                    This assignment invalidates h->prefix.  */
-                 current_header->oldgnu_header.isextended = 0;
                }
              memcpy (np, h->name, sizeof h->name);
              np[sizeof h->name] = '\0';
@@ -1103,7 +1098,9 @@ print_header (struct tar_stat_info *st, off_t block_ordinal)
 
       /* User and group names.  */
 
-      if (st->uname && current_format != V7_FORMAT
+      if (st->uname
+         && st->uname[0]
+         && current_format != V7_FORMAT
          && !numeric_owner_option)
        user = st->uname;
       else
@@ -1126,7 +1123,9 @@ print_header (struct tar_stat_info *st, off_t block_ordinal)
            }
        }
 
-      if (st->gname && current_format != V7_FORMAT
+      if (st->gname
+         && st->gname[0]
+         && current_format != V7_FORMAT
          && !numeric_owner_option)
        group = st->gname;
       else
@@ -1310,7 +1309,7 @@ skip_member (void)
   char save_typeflag = current_header->header.typeflag;
   set_next_block_after (current_header);
 
-  assign_string (&save_name, current_stat_info.file_name);
+  assign_string (&save_name, current_stat_info.orig_file_name);
 
   if (current_stat_info.is_sparse)
     sparse_skip_file (&current_stat_info);
This page took 0.02115 seconds and 4 git commands to generate.