summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2023-03-28 08:10:56 -0300
committerDavid Bremner <david@tethera.net>2023-03-28 08:10:56 -0300
commitf76dc66ba3c44764df76658541df375058f21f21 (patch)
tree079d0de285467e69e860992a67ad56934d906e73
parentdb5fe414a7b3309c1d3ed90ebf00c6fe5ad83cdc (diff)
Commit patch queue (exported by git-debrebase)debian/3.3.0-3archive/debian/3.3.0-3
[git-debrebase make-patches: export and commit patches]
-rw-r--r--debian/patches/0002-Change-a-use-of-is_realzero-to-just-is_zero.patch22
-rw-r--r--debian/patches/series1
2 files changed, 23 insertions, 0 deletions
diff --git a/debian/patches/0002-Change-a-use-of-is_realzero-to-just-is_zero.patch b/debian/patches/0002-Change-a-use-of-is_realzero-to-just-is_zero.patch
new file mode 100644
index 00000000..eb992893
--- /dev/null
+++ b/debian/patches/0002-Change-a-use-of-is_realzero-to-just-is_zero.patch
@@ -0,0 +1,22 @@
+From: John Wiegley <johnw@newartisans.com>
+Date: Thu, 23 Mar 2023 11:23:39 -0700
+Subject: Change a use of is_realzero to just is_zero
+
+This is needed to avoid a possible divide by zero.
+---
+ src/pool.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pool.cc b/src/pool.cc
+index 2c055d6..73e7664 100644
+--- a/src/pool.cc
++++ b/src/pool.cc
+@@ -257,7 +257,7 @@ commodity_pool_t::exchange(const amount_t& amount,
+ current_annotation = &as_annotated_commodity(commodity).details;
+
+ amount_t per_unit_cost =
+- (is_per_unit || amount.is_realzero()) ? cost.abs() : (cost / amount).abs();
++ (is_per_unit || amount.is_zero()) ? cost.abs() : (cost / amount).abs();
+
+ if (! cost.has_commodity())
+ per_unit_cost.clear_commodity();
diff --git a/debian/patches/series b/debian/patches/series
index d80b733e..aac8de27 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
0001-Do-not-perform-commodity-reduction-when-parsing-a-fo.patch
+0002-Change-a-use-of-is_realzero-to-just-is_zero.patch