The current code for strextract assumes the search start is shorter than the length of the input string.
If we want to extract a substring starting at the beginning of a string, we might want to use the input string as the search start string. However, this doesn't work for the current implementation due to:
begin += strlen(search_start);
I can see reasons for both implementations; maybe we could include an argument that specifies the desired behavior.
The current code for strextract assumes the
search startis shorter than the length of the input string.If we want to extract a substring starting at the beginning of a string, we might want to use the input string as the
search startstring. However, this doesn't work for the current implementation due to:I can see reasons for both implementations; maybe we could include an argument that specifies the desired behavior.