https://www.gnu.org/software/findutils/manual/index.html (as of today
at least) is incorrect.   It says:

$ links -dump 'https://www.gnu.org/software/findutils/manual/index.html'
| sed -n  -e 's/^/> /'   -e '/GNU findutils - Finding Files/,/You can
buy/ p'
> GNU findutils - Finding Files
>
>     Free Software Foundation
>
>     last updated July 14, 2026
>
>    This manual (find) is available in the following formats:
>
>      * HTML (1K bytes) - entirely on one web page.
>      * HTML - with one web page per node.
>      * HTML compressed (121K gzipped characters) - entirely on one web page.
>      * HTML compressed (157K gzipped tar file) - with one web page per node.
>      * Info document (101K bytes gzipped tar file).
>      * ASCII text (1K bytes).
>      * ASCII text compressed (97K bytes gzipped).
>      * TeX dvi file (1K bytes gzipped).
>      * PDF file (1K bytes).
>      * Texinfo source (125K bytes gzipped tar file).
>
>    You can buy printed copies of some manuals (among other items) from the

Notice that the "entirely on one web page" version is shown as "1K
bytes".  This is incorrect.  The problem is that gendocs.sh is
mearuring the size of the file using "ls -s".  The attached patch
fixes this problem.

I already have a past & future copyright assignment on file for gnulib
(dated 2005-09-01).
From 900c7c980ce9ab147a772369396fde4426186370 Mon Sep 17 00:00:00 2001
From: James Youngman <[email protected]>
Date: Fri, 17 Jul 2026 12:55:29 +0100
Subject: [PATCH] gendocs: correct the calculation of file sizes.

* build-aux/gendocs.sh (calcsize): do not assume "ls -sk" tells us the
size of the file in KiB.  Calculate it from the file length instead.
---
 build-aux/gendocs.sh | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 80b0a17368..2b3373ecf7 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,7 +2,7 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2026-01-01.00
+scriptversion=2026-07-17.13
 
 # Copyright 2003-2026 Free Software Foundation, Inc.
 #
@@ -230,10 +230,24 @@ if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
 fi
 
 # Function to return size of $1 in something resembling kilobytes.
+# We don't use `ls -s` because that can be longer or shorter than
+# the real length of the data (because the file system compresses
+# the file, for example).  We don't use `du -k --apparent-size`
+# because we do not want to assume `du` supports that option.
+#
+# Here's an example of different `ls -s` results on different file
+# systems:
+#
+# $ cp /var/tmp/findutils-manual/find.html find.html
+# $ ls -lsh /var/tmp/findutils-manual/find.html find.html
+# 221K -rw-rw-r-- 1 james james 582K Jul 17 13:01 find.html
+# 584K -rw-rw-r-- 1 james james 582K Jul 17 12:54 /var/tmp/findutils-manual/find.html
 calcsize()
 {
-  set `ls -ks "$1"`
-  echo $1
+  # Determine size in bytes
+  set `env LC_ALL=C wc -c < "$1"`
+  # Emit the size in KiB, rounding up.
+  expr '(' "$1" + 1023 ')' / 1024
 }
 
 # copy_images OUTDIR HTML-FILE...
-- 
2.47.3

Reply via email to