# 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.
#
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...