On 16.06.2020 13:19, Tobias Bading wrote:
> Hi,
>
> a file with size 264901826 bytes (don’t ask!!) causes “svn list -vH URL-OF-FILE-IN-REPO” (using Subversion 1.14) to abort with
>
> svn: subversion/svn/filesize.c:93: format_size: Assertion `absolute_human_readable_size < 1000.0' failed.
>
> on GNU/Linux. As it turns out, get_base2_unit_file_size() in subversion/svn/filesize.c produces nonsense. Nonsense as in “humbug for files larger than 1 MB”. My guess would be that this is what the author was aiming for: (assuming the result is supposed to have roughly two decimals)
The result is supposed to have up to three decimal digits, that's the
reason for the assertion. Interesting ...
> Index: filesize.c
> ===================================================================
> --- filesize.c (revision 1878396)
> +++ filesize.c (working copy)
> @@ -139,7 +139,7 @@
> ++index;
> }
> human_readable_size = (index == 0 ? (double)size
> - : (size >> 3 * index) / 128.0 / index);
> + : (double)(size >> (10 * index - 7)) / 128.0);
Thanks for tracking this down, I'll take a look. The explicit cast to
(double) isn't necessary, by the way; it's implied by the division by 128.0.
-- Brane
Received on 2020-06-16 13:52:56 CEST