No need to argue... with this tiny patch wget will print nice and standard KiB MiB GiB binary units... A don't like ambiguity, not binary. Hope this will help futile discussion about 10 way of look at the world... and Merry Christmass to everyone, to people that understand binary, people doesn't and ambiguous one.


Index: progress.c =================================================================== RCS file: /pack/anoncvs/wget/src/progress.c,v retrieving revision 1.43 diff -u -r1.43 progress.c --- progress.c 2004/01/28 01:02:26 1.43 +++ progress.c 2004/12/26 15:25:21 @@ -727,7 +727,7 @@ struct bar_progress_hist *hist = &bp->hist;

  /* The progress bar should look like this:
-     xx% [=======>             ] nn,nnn 12.34K/s ETA 00:00
+     xx% [=======>             ] nn,nnn 12.34 KiB/s ETA 00:00

Calculate the geometry. The idea is to assign as much room as
possible to the progress bar. The other idea is to never let
@@ -739,13 +739,13 @@
"xx% " or "100%" - percentage - 4 chars
"[]" - progress bar decorations - 2 chars
" nnn,nnn,nnn" - downloaded bytes - 12 chars or very rarely more
- " 1012.56K/s" - dl rate - 11 chars
+ " 1012.56 KiB/s" - dl rate - 14 chars
" ETA xx:xx:xx" - ETA - 13 chars


     "=====>..."       - progress bar             - the rest
  */
  int dlbytes_size = 1 + MAX (size_legible_len, 11);
-  int progress_size = bp->width - (4 + 2 + dlbytes_size + 11 + 13);
+  int progress_size = bp->width - (4 + 2 + dlbytes_size + 14 + 13);

  if (progress_size < 5)
    progress_size = 0;
@@ -831,10 +831,10 @@
  sprintf (p, " %-11s", legible (size));
  p += strlen (p);

- /* " 1012.45K/s" */
+ /* " 1012.45 KiB/s" */
if (hist->total_time && hist->total_bytes)
{
- static const char *short_units[] = { "B/s", "K/s", "M/s", "G/s" };
+ static const char *short_units[] = { "Byte/s", " KiB/s", " MiB/s", " GiB/s" };
int units = 0;
/* Calculate the download speed using the history ring and
recent data that hasn't made it to the ring yet. */
@@ -845,7 +845,7 @@
p += strlen (p);
}
else
- APPEND_LITERAL (" --.--K/s");
+ APPEND_LITERAL (" --.-- KiB/s");


/* " ETA xx:xx:xx"; wait for three seconds before displaying the ETA.
That's because the ETA value needs a while to become
Index: retr.c
===================================================================
RCS file: /pack/anoncvs/wget/src/retr.c,v
retrieving revision 1.86
diff -u -r1.86 retr.c
--- retr.c 2004/11/18 21:05:30 1.86
+++ retr.c 2004/12/26 15:25:42
@@ -492,7 +492,7 @@
retr_rate (long bytes, double msecs, int pad)
{
static char res[20];
- static const char *rate_names[] = {"B/s", "KB/s", "MB/s", "GB/s" };
+ static const char *rate_names[] = {"Byte/s", " KiB/s", " MiB/s", " GiB/s" };
int units = 0;


  double dlrate = calc_rate (bytes, msecs, &units);





Reply via email to