+ if (logical_status == HEADER_END_OF_FILE)
+ {
+ /* Write the end of tape. FIXME: we can't use write_eot here,
+ as it gets confused when the input is at end of file. */
+
+ int total_zero_blocks = 0;
+
+ do
+ {
+ int zero_blocks = blocking_factor - new_blocks;
+ memset (new_record + new_blocks, 0, BLOCKSIZE * zero_blocks);
+ total_zero_blocks += zero_blocks;
+ write_record (total_zero_blocks < 2);
+ }
+ while (total_zero_blocks < 2);
+ }
+
+ free (new_record);
+
+ if (! acting_as_filter && ! _isrmt (archive))
+ {
+#if MSDOS
+ int status = write (archive, "", 0);
+#else
+ off_t pos = lseek (archive, (off_t) 0, SEEK_CUR);
+ int status = pos < 0 ? -1 : ftruncate (archive, pos);
+#endif
+ if (status != 0)
+ truncate_warn (archive_name_array[0]);
+ }
+