From 696363c8dd1637fda63d45f98b4474803bba87b3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 22 Apr 2004 18:01:31 +0000 Subject: Instead of traversing a list of paragraphs, mark_attr_ends() now merely traverses a list of words, and main() takes responsibility for applying it to each paragraph in the document. This is so that it can _also_ be applied to the display form of each index entry, which Jacob spotted wasn't previously being done. [originally from svn r4117] --- main.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 18d644c..847aea8 100644 --- a/main.c +++ b/main.c @@ -288,8 +288,6 @@ int main(int argc, char **argv) { sfree(in.pushback); - mark_attr_ends(sourceform); - sfree(infiles); keywords = get_keywords(sourceform); @@ -304,6 +302,20 @@ int main(int argc, char **argv) { build_index(idx); + /* + * Set up attr_First / attr_Last / attr_Always, in the main + * document and in the index entries. + */ + for (p = sourceform; p; p = p->next) + mark_attr_ends(p->words); + { + int i; + indexentry *entry; + + for (i = 0; (entry = index234(idx->entries, i)) != NULL; i++) + mark_attr_ends(entry->text); + } + if (debug) { index_debug(idx); dbg_prtkws(keywords); -- cgit v1.1