]> Dogcows Code - chaz/tar/blobdiff - src/buffer.c
* src/buffer.c (short_read): Remove !read_full_records condition,
[chaz/tar] / src / buffer.c
index c544ee00d85b5b9a862035dadbce8636f57f52c5..59d4e4f0c16c4c793f1d97e6fb3c67923fbd1150 100644 (file)
@@ -686,6 +686,18 @@ short_read (size_t status)
   more = record_start->buffer + status;
   left = record_size - status;
 
+  if (left && left % BLOCKSIZE == 0
+      && verbose_option
+      && record_start_block == 0 && status != 0)
+    {
+      unsigned long rsize = status / BLOCKSIZE;
+      WARN ((0, 0,
+             ngettext ("Record size = %lu block",
+                       "Record size = %lu blocks",
+                       rsize),
+             rsize));
+    }
+
   while (left % BLOCKSIZE != 0
          || (left && status && read_full_records))
     {
@@ -707,26 +719,10 @@ short_read (size_t status)
                         rest));
         }
 
-      /* User warned us about this.  Fix up.  */
-
       left -= status;
       more += status;
     }
 
-  /* FIXME: for size=0, multi-volume support.  On the first record, warn
-     about the problem.  */
-
-  if (!read_full_records && verbose_option > 1
-      && record_start_block == 0 && status != 0)
-    {
-      unsigned long rsize = (record_size - left) / BLOCKSIZE;
-      WARN ((0, 0,
-             ngettext ("Record size = %lu block",
-                       "Record size = %lu blocks",
-                       rsize),
-             rsize));
-    }
-
   record_end = record_start + (record_size - left) / BLOCKSIZE;
   records_read++;
 }
@@ -1571,6 +1567,9 @@ _gnu_flush_read (void)
         {
           while (!try_new_volume ())
             ;
+         if (current_block == record_end)
+           /* Necessary for blocking_factor == 1 */
+           flush_archive();
           return;
         }
       else if (status == SAFE_READ_ERROR)
This page took 0.021084 seconds and 4 git commands to generate.