mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05: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:
parent
aafebad3f5
commit
812c4bafc1
@ -293,9 +293,9 @@ 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';
|
||||
}
|
||||
if (s1[i].n == 0)
|
||||
doc[i] = '\n';
|
||||
else
|
||||
doc[i] = s1[i].c;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user