The return state returns `F_okay_eos` or `F_okay_stop` accordingly.
This can be inferred to be content found, but not consistently.
It is better to return `F_content_found`.
Anything using this can now more consistently rely on the `F_content_found` status.
The end of string and buffer location checks should already be being performed by the caller anyway.
The **API** doesn't go into details on this behavior which leaves room for this change without breaking **API** or **ABI**.
This is back ported from ongoing changed from the `0.8` branch.
return status;
}
- if (range->start >= buffer.used) {
- found->array[found->used].stop = buffer.used - 1;
-
- return F_none_eos;
- }
-
- if (range->start > range->stop) {
- found->array[found->used].stop = range->stop;
-
- return F_none_stop;
- }
-
if (range->start > begin) {
- found->array[found->used++].stop = range->start - 1;
+ if (range->start >= buffer.used) {
+ found->array[found->used++].stop = buffer.used - 1;
+ }
+ else if (range->start > range->stop) {
+ found->array[found->used++].stop = range->stop;
+ }
+ else {
+ found->array[found->used++].stop = range->start - 1;
+ }
}
else {
found->array[found->used].start = 1;