/[tar]/tar/src/buffer.c
ViewVC logotype

Diff of /tar/src/buffer.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.82 by gray, Thu Apr 7 17:26:11 2005 UTC revision 1.83 by eggert, Mon Apr 18 18:21:50 2005 UTC
# Line 73  static bool hit_eof; Line 73  static bool hit_eof;
73  static int checkpoint;  static int checkpoint;
74    
75  static bool read_full_records = false;  static bool read_full_records = false;
 static bool reading_from_pipe = false;  
76    
77  /* We're reading, but we just read the last block and it's time to update.  /* We're reading, but we just read the last block and it's time to update.
78     Declared in update.c     Declared in update.c
# Line 182  enum compress_type Line 181  enum compress_type
181  check_compressed_archive ()  check_compressed_archive ()
182  {  {
183    struct zip_magic const *p;    struct zip_magic const *p;
184    bool sfr, srp;    bool sfr;
185    
186    /* Prepare global data needed for find_next_block: */    /* Prepare global data needed for find_next_block: */
187    record_end = record_start; /* set up for 1st record = # 0 */    record_end = record_start; /* set up for 1st record = # 0 */
188    sfr = read_full_records;    sfr = read_full_records;
189    read_full_records = true; /* Suppress fatal error on reading a partial    read_full_records = true; /* Suppress fatal error on reading a partial
190                                 record */                                 record */
   srp = reading_from_pipe;  
   reading_from_pipe = true; /* Suppress warning message on reading a partial  
                                record */  
191    find_next_block ();    find_next_block ();
192    
193    /* Restore global values */    /* Restore global values */
194    read_full_records = sfr;    read_full_records = sfr;
   reading_from_pipe = srp;  
195    
196    if (tar_checksum (record_start, true) == HEADER_SUCCESS)    if (tar_checksum (record_start, true) == HEADER_SUCCESS)
197      /* Probably a valid header */      /* Probably a valid header */
# Line 236  open_compressed_archive () Line 231  open_compressed_archive ()
231        /* Open compressed archive */        /* Open compressed archive */
232        use_compress_program_option = compress_program (type);        use_compress_program_option = compress_program (type);
233        child_pid = sys_child_open_for_uncompress ();        child_pid = sys_child_open_for_uncompress ();
234        read_full_records = reading_from_pipe = true;        read_full_records = true;
235      }      }
236    
237    records_read = 0;    records_read = 0;
# Line 406  open_archive (enum access_mode wanted_ac Line 401  open_archive (enum access_mode wanted_ac
401    access_mode = wanted_access == ACCESS_UPDATE ? ACCESS_READ : wanted_access;    access_mode = wanted_access == ACCESS_UPDATE ? ACCESS_READ : wanted_access;
402    
403    read_full_records = read_full_records_option;    read_full_records = read_full_records_option;
   reading_from_pipe = false;  
404    
405    records_read = 0;    records_read = 0;
406    
# Line 416  open_archive (enum access_mode wanted_ac Line 410  open_archive (enum access_mode wanted_ac
410          {          {
411          case ACCESS_READ:          case ACCESS_READ:
412            child_pid = sys_child_open_for_uncompress ();            child_pid = sys_child_open_for_uncompress ();
413            read_full_records = reading_from_pipe = true;            read_full_records = true;
414            record_end = record_start; /* set up for 1st record = # 0 */            record_end = record_start; /* set up for 1st record = # 0 */
415            break;            break;
416    
# Line 760  short_read (size_t status) Line 754  short_read (size_t status)
754            archive_read_error ();            archive_read_error ();
755    
756        if (status == 0)        if (status == 0)
757          {          break;
           if (!reading_from_pipe)  
             {  
               char buf[UINTMAX_STRSIZE_BOUND];  
   
               WARN((0, 0,  
                     ngettext ("Read %s byte from %s",  
                               "Read %s bytes from %s",  
                               record_size - left),  
                     STRINGIFY_BIGINT (record_size - left, buf),  
                     *archive_name_cursor));  
             }  
           break;  
         }  
758    
759        if (! read_full_records)        if (! read_full_records)
760          {          {

Legend:
Removed from v.1.82  
changed lines
  Added in v.1.83

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26