1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

get_search_region_from_search_nodes: add comment

Document why we add pattern_len to doclen.
This commit is contained in:
Miciah Dashiel Butler Masters 2008-12-27 12:38:51 +00:00
parent 812c4bafc1
commit bd752e95ad

View File

@ -283,6 +283,9 @@ get_search_region_from_search_nodes(struct search *s1, struct search *s2,
UCHAR *doc;
int i;
/* We must include @a pattern_len in this expression because get_range
* caps the end of the search region, @a s2, to the length of the
* document minus the length of the search pattern. */
*doclen = s2 - s1 + pattern_len;
if (!*doclen) return NULL;