BUG/MINOR: sample: Make the `field` converter compatible with `-m found`
Previously an expression like:
path,field(2,/) -m found
always returned `true`.
Bug exists since the `field` converter exists. That is:
f399b0debfc6c7dc17c6ad503885c911493add56
The fix should be backported to 1.6+.
(cherry picked from commit 4381d26edc03faa46401eb0fe82fd7be84be14fd)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/sample.c b/src/sample.c
index ab25726..8094b04 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -2073,7 +2073,7 @@
/* Field not found */
if (field != arg_p[0].data.sint) {
smp->data.u.str.data = 0;
- return 1;
+ return 0;
}
found:
smp->data.u.str.data = end - start;