help-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-tar] --exclude partially working with --format=posix ?


From: Sergey Poznyakoff
Subject: Re: [Help-tar] --exclude partially working with --format=posix ?
Date: Wed, 23 Jun 2010 09:53:18 +0300

Hi Matthew,

>    I'm seeing unusual behavior creating archives using --format=posix and
>    then attempting to extract them using the --exclude option.

Thanks for reporting.  Please try the attached patch.

Regards,
Sergey

diff --git a/src/compare.c b/src/compare.c
index f4e92da..437ffb3 100644
--- a/src/compare.c
+++ b/src/compare.c
@@ -452,7 +452,6 @@ diff_archive (void)
 {
 
   set_next_block_after (current_header);
-  decode_header (current_header, &current_stat_info, &current_format, 1);
 
   /* Print the block from current_header and current_stat_info.  */
 
diff --git a/src/extract.c b/src/extract.c
index 531654a..1175322 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -1279,7 +1279,7 @@ extract_archive (void)
   priv_set_remove_linkdir ();
 
   set_next_block_after (current_header);
-  decode_header (current_header, &current_stat_info, &current_format, 1);
+
   if (!current_stat_info.file_name[0]
       || (interactive_option
          && !confirm ("extract", current_stat_info.file_name)))
diff --git a/src/list.c b/src/list.c
index ac7c8fb..1b4bbb5 100644
--- a/src/list.c
+++ b/src/list.c
@@ -90,7 +90,8 @@ read_and (void (*do_something) (void))
 
          /* Valid header.  We should decode next field (mode) first.
             Ensure incoming names are null terminated.  */
-
+         decode_header (current_header, &current_stat_info,
+                        &current_format, 1);
          if (! name_match (current_stat_info.file_name)
              || (NEWER_OPTION_INITIALIZED (newer_mtime_option)
                  /* FIXME: We get mtime now, and again later; this causes
@@ -116,8 +117,6 @@ read_and (void (*do_something) (void))
                           quotearg_colon (current_stat_info.file_name)));
                  /* Fall through.  */
                default:
-                 decode_header (current_header,
-                                &current_stat_info, &current_format, 0);
                  skip_member ();
                  continue;
                }
@@ -211,7 +210,6 @@ list_archive (void)
 
   /* Print the header block.  */
   
-  decode_header (current_header, &current_stat_info, &current_format, 0);
   if (verbose_option)
     print_header (&current_stat_info, current_header, block_ordinal);
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]