Fix the rate calculation when --bits is used - patch from user mojohakase (#182).

This commit is contained in:
Andrew Wood
2026-03-21 22:28:27 +00:00
parent a33ee8ef26
commit a063b95005
3 changed files with 5 additions and 3 deletions
+1
View File
@@ -111,6 +111,7 @@ is acknowledged and greatly appreciated:
* Andriy Galetski, and also [thinrope](https://codeberg.org/thinrope) - suggested the "**--sparse**" option ([#45](https://codeberg.org/ivarch/pv/issues/45))
* [KimHansen](https://codeberg.org/KimHansen) - suggested that "**--watchfd**" should keep its display when the process ends ([#81](https://codeberg.org/ivarch/pv/issues/81))
* [njt](https://codeberg.org/njt) - suggested that "**--size** @*PATH*" should accept directories ([#179](https://codeberg.org/ivarch/pv/issues/179))
* [mojohakase](https://codeberg.org/mojohakase) - provided fix for multiplication bug when combining "**--bits**" with "**--gauge**" ([#182](https://codeberg.org/ivarch/pv/issues/182))
Translations provided through [Codeberg Weblate](https://translate.codeberg.org/projects/pv/):
+4
View File
@@ -1,3 +1,7 @@
### UNRELEASED
* *fix:* when using **--bits** with **--gauge**, don't incorrectly multiply the rate twice ([#182](https://codeberg.org/ivarch/pv/issues/182))
### 1.10.4 - 8 March 2026
* *fix:* when using **--size @PATH**, *PATH* can be a directory, and the total size of all files within it will be used ([#179](https://codeberg.org/ivarch/pv/issues/179))
-3
View File
@@ -119,9 +119,6 @@ void pv_calculate_transfer_rate(pvtransfercalc_t calc, readonly_pvtransferstate_
calc->prev_elapsed_sec = transfer->elapsed_seconds;
calc->prev_trans = 0;
if (control->bits)
measured_rate = 8.0 * measured_rate;
if ((calc->measurements_taken < 1) || (measured_rate < calc->rate_min)) {
calc->rate_min = measured_rate;
}