1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00

get_search_region_from_search_nodes: simplify

Simplify the end-of-line check in get_search_region_from_search_nodes by
relying on the fact that the n member of an instance of struct search
that marks the end of a line will be 0.
This commit is contained in:
Miciah Dashiel Butler Masters 2008-12-27 12:07:12 +00:00
parent aafebad3f5
commit 812c4bafc1

View File

@ -293,10 +293,10 @@ get_search_region_from_search_nodes(struct search *s1, struct search *s2,
}
for (i = 0; i < *doclen; i++) {
if (i > 0 && s1[i - 1].c == ' ' && s1[i - 1].y != s1[i].y) {
doc[i - 1] = '\n';
}
doc[i] = s1[i].c;
if (s1[i].n == 0)
doc[i] = '\n';
else
doc[i] = s1[i].c;
}
doc[*doclen] = 0;