From: Benno Schulenberg Date: Mon, 16 Mar 2026 11:09:37 +0000 (+0100) Subject: copyfilerange: wrap some overlong lines (in a tabsize-independent way) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=085ed2f3dfcdf888c786b0885b09c821073ec256;p=thirdparty%2Futil-linux.git copyfilerange: wrap some overlong lines (in a tabsize-independent way) Most tools in util-linux seem to assume a tabsize of 8, judging from the alignments of several continuation lines. But `copyfilerange.c` appears to have assumed a tabsize of 2, because with a tabsize of 8 the text on line 147 started in column 209! But even with a tabsize of 2, three lines were much wider than the reasonable 100 columns. So, wrap those, and in the bargain improve the wording of the affected messages, and add a space before %m. CC: Dick Marinus Signed-off-by: Benno Schulenberg --- diff --git a/misc-utils/copyfilerange.c b/misc-utils/copyfilerange.c index 5ee562d22..03b9e1001 100644 --- a/misc-utils/copyfilerange.c +++ b/misc-utils/copyfilerange.c @@ -133,19 +133,23 @@ static void copy_range(struct rangeitem *range) { uintmax_t remaining = range->length; if (range->in_offset > range->in_st_size) - errx(EXIT_FAILURE, _("%s offset %"PRId64" beyond file size of %"PRId64""), range->in_filename, range->in_offset, range->in_st_size); + errx(EXIT_FAILURE, _("%s offset %"PRId64" is beyond file size of %"PRId64""), + range->in_filename, range->in_offset, range->in_st_size); while (remaining > 0) { const size_t chunk = remaining > SIZE_MAX ? SIZE_MAX : remaining; if (verbose) - printf("copy_file_range %s to %s %"PRId64":%"PRId64":%zu\n", range->in_filename, - range->out_filename, range->in_offset, range->out_offset, chunk); + printf("copy_file_range %s to %s %"PRId64":%"PRId64":%zu\n", + range->in_filename, range->out_filename, + range->in_offset, range->out_offset, chunk); - const ssize_t copied = copy_file_range(range->in_fd, &range->in_offset, range->out_fd, - &range->out_offset, chunk, 0); + const ssize_t copied = copy_file_range(range->in_fd, &range->in_offset, + range->out_fd, &range->out_offset, chunk, 0); if (copied < 0) - errx(EXIT_FAILURE, _("failed copy file range %"PRId64":%"PRId64":%ju from %s to %s with remaining %ju:%m\n"), - range->in_offset, range->out_offset, range->length, range->in_filename, range->out_filename, remaining); + errx(EXIT_FAILURE, _("failed to copy range %"PRId64":%"PRId64":%ju " + "from %s to %s with %ju remaining: %m\n"), + range->in_offset, range->out_offset, range->length, + range->in_filename, range->out_filename, remaining); if (copied == 0) break;