From 812c4bafc15669a69289055fa552a03b3cfdb939 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Sat, 27 Dec 2008 12:07:12 +0000 Subject: [PATCH] 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. --- src/viewer/text/search.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/viewer/text/search.c b/src/viewer/text/search.c index 5a6f0198..7dabfe92 100644 --- a/src/viewer/text/search.c +++ b/src/viewer/text/search.c @@ -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;