+static void
+short_read (ssize_t status)
+{
+ size_t left; /* bytes left */
+ char *more; /* pointer to next byte to read */
+
+ more = record_start->buffer + status;
+ left = record_size - status;
+
+ while (left % BLOCKSIZE != 0
+ || (left && status && read_full_records_option))
+ {
+ if (status)
+ while ((status = rmtread (archive, more, left)) < 0)
+ archive_read_error ();
+
+ if (status == 0)
+ break;
+
+ if (! read_full_records_option)
+ {
+ unsigned long rest = record_size - left;
+
+ FATAL_ERROR ((0, 0,
+ ngettext ("Unaligned block (%lu byte) in archive",
+ "Unaligned block (%lu bytes) in archive",
+ rest),
+ 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_option && verbose_option
+ && 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++;
+}
+