- /*
- * JK - This is the test for sparseness: whether the
- * "size" of the file matches the number of blocks
- * allocated for it. If there is a smaller number
- * of blocks that would be necessary to accommodate
- * a file of this size, we have a sparse file, i.e.,
- * at least one of those records in the file is just
- * a useless hole.
- */
-#ifdef hpux /* Nice of HPUX to gratuitiously change it, huh? - mib */
- if (hstat.st_size - (hstat.st_blocks * 1024) > 1024)
-#else
- if (hstat.st_size - (hstat.st_blocks * RECORDSIZE) > RECORDSIZE)
-#endif
- {
- int filesize = hstat.st_size;
- register int i;
-
- header = start_header (p, &hstat);
- if (header == NULL)
- {
- critical_error = 1;
- goto badfile;
- }
- header->header.linkflag = LF_SPARSE;
- header_moved++;
-
- /*
- * Call the routine that figures out the
- * layout of the sparse file in question.
- * UPPERBOUND is the index of the last
- * element of the "sparsearray," i.e.,
- * the number of elements it needed to
- * describe the file.
- */
-
- upperbound = deal_with_sparse (p, header);
-
- /*
- * See if we'll need an extended header
- * later
- */
- if (upperbound > SPARSE_IN_HDR - 1)
- header->header.isextended++;
- /*
- * We store the "real" file size so
- * we can show that in case someone wants
- * to list the archive, i.e., tar tvf <file>.
- * It might be kind of disconcerting if the
- * shrunken file size was the one that showed
- * up.
- */
- to_oct ((long) hstat.st_size, 1 + 12,
- header->header.realsize);
-
- /*
- * This will be the new "size" of the
- * file, i.e., the size of the file
- * minus the records of holes that we're
- * skipping over.
- */
-
- find_new_file_size (&filesize, upperbound);
- hstat.st_size = filesize;
- to_oct ((long) filesize, 1 + 12,
- header->header.size);
- /* to_oct((long) end_nulls, 1+12,
- header->header.ending_blanks);*/
-
- for (i = 0; i < SPARSE_IN_HDR; i++)
- {
- if (!sparsearray[i].numbytes)
- break;
- to_oct (sparsearray[i].offset, 1 + 12,
- header->header.sp[i].offset);
- to_oct (sparsearray[i].numbytes, 1 + 12,
- header->header.sp[i].numbytes);
- }
-
- }
+ int negsub;
+ uintmax_t sub = substitute (&negsub) & maxval;
+ /* FIXME: This is the only place where GNU_FORMAT differs from
+ OLDGNU_FORMAT. Apart from this they are completely identical. */
+ uintmax_t s = (negsub &= archive_format == GNU_FORMAT) ? - sub : sub;
+ char subbuf[UINTMAX_STRSIZE_BOUND + 1];
+ char *sub_string = STRINGIFY_BIGINT (s, subbuf + 1);
+ if (negsub)
+ *--sub_string = '-';
+ WARN ((0, 0, _("value %s out of %s range %s..%s; substituting %s"),
+ value_string, type, minval_string, maxval_string,
+ sub_string));
+ to_chars (negsub, s, valsize, 0, where, size, type);