Fix indices/1 and rindex/1 in case of overlapping matches in strings

Fixes #2433
This commit is contained in:
Emanuele Torre authored and Nico Williams committed 2023-07-14 23:40:37 -05:00
1 parent bf4390562f
commit 1915b689f7
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -1296,7 +1296,7 @@ jv jv_string_indexes(jv j, jv k) {
p = jstr;
while ((p = _jq_memmem(p, (jstr + jlen) - p, idxstr, idxlen)) != NULL) {
a = jv_array_append(a, jv_number(p - jstr));
p += idxlen;
p++;
}
}
jv_free(j);