summaryrefslogtreecommitdiff
path: root/user/xapian-core/sortable-serialise.patch
blob: d7cb9209ac235df95aa1cfc94c1a8eee91e42e9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Discussing with upstream, but for now, this does fix both the test suite
and operationally the ability to serialise +Inf values.
--- xapian-core-1.4.25/api/sortable-serialise.cc.old	2024-03-07 16:57:54.000000000 -0600
+++ xapian-core-1.4.25/api/sortable-serialise.cc	2024-05-30 00:49:54.835053392 -0500
@@ -55,6 +55,10 @@
 
     // Negative infinity.
     if (value < -DBL_MAX) return 0;
+    if (value == HUGE_VAL) {
+	memset(buf, '\xff', 9);
+	return 9;
+    }
 
     mantissa = frexp(value, &exponent);