[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

"svn list -vH" broken for files >1M

From: Tobias Bading <tbading_at_web.de>
Date: Tue, 16 Jun 2020 13:19:22 +0200

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)

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);

return format_size(human_readable_size,
long_units, order, index, result_pool);

Kind Regards,
Tobias
Received on 2020-06-16 13:24:50 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.