Commit 152dd84a authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Lasse Karstensen

Handle whitespace after floats in test fields

Broken in 9bb8f962.
Committed solution proposed by phk@, discussed with phk@ and martin@.

Fixes #1845.
parent c371fe88
......@@ -151,6 +151,12 @@ logexpect l1 -d 1 -g vxid -q "RespHeader[2] == 123" {
expect * = End
} -run
# Test field on floats
logexpect l1 -d 1 -g vxid -q "RespHeader[2] == 123." {
expect 0 * Begin req
expect * = End
} -run
# Test taglists
logexpect l1 -d 1 -g vxid -q "Debug,Resp* == 200" {
expect 0 * Begin req
......
......@@ -78,7 +78,7 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
const struct vex_rhs *rhs;
long long lhs_int = 0;
double lhs_float = 0.;
const char *b, *e;
const char *b, *e, *q;
char *p;
int i;
......@@ -145,9 +145,11 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
/* Can't parse - no match */
return (0);
case VEX_FLOAT:
lhs_float = VNUM(b);
lhs_float = VNUMpfx(b, &q);
if (isnan(lhs_float))
return (0);
if (q != NULL && q > p && !isspace(q[-1]))
return (0);
break;
default:
WRONG("Wrong RHS type");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment