[master] d3db14608 vxp: fix vslq_test_rec() for FreeBSD
Nils Goroll
nils.goroll at uplex.de
Wed Jun 5 09:22:05 UTC 2024
commit d3db146082d722d06efe74b681c161f2fdc5903d
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Wed Jun 5 11:17:38 2024 +0200
vxp: fix vslq_test_rec() for FreeBSD
the actual issue was that strtoll(".456", ...) sets errno 22, so when
we fall back to strtod(), we need to clear it.
Ref 0ca8d177178b94622a3a8a939f383d6abc1952c7
Ref 0dfa3b8c95f67054989a0e9259069e2f2433497a
Fixes #4088
Yes, I did install FreeBSD, and it's been a nice refreshing no-frills experience
so far.
diff --git a/lib/libvarnishapi/vsl_query.c b/lib/libvarnishapi/vsl_query.c
index 73824345b..48874e2d6 100644
--- a/lib/libvarnishapi/vsl_query.c
+++ b/lib/libvarnishapi/vsl_query.c
@@ -211,6 +211,7 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
lhs_int = strtoll(b, &q, 0);
AN(q);
if (q != e && (*q == '.' || *q == 'e')) {
+ errno = 0;
lhs_float = strtod(b, &q);
lhs_int = (long long)lhs_float;
lhs_float = 0.;
More information about the varnish-commit
mailing list