diff options
| author | Simon Tatham <anakin@pobox.com> | 2004-04-22 18:01:31 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2004-04-22 18:01:31 +0000 |
| commit | 696363c8dd1637fda63d45f98b4474803bba87b3 (patch) | |
| tree | df4134bb5cf60802f3ead1090109a78ad6915c43 /misc.c | |
| parent | 3e7ac03ca71c9b93c73fa58fd1de9a2042ec13d7 (diff) | |
| download | halibut-696363c8dd1637fda63d45f98b4474803bba87b3.zip halibut-696363c8dd1637fda63d45f98b4474803bba87b3.tar.gz halibut-696363c8dd1637fda63d45f98b4474803bba87b3.tar.bz2 halibut-696363c8dd1637fda63d45f98b4474803bba87b3.tar.xz | |
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]
Diffstat (limited to 'misc.c')
| -rw-r--r-- | misc.c | 29 |
1 files changed, 14 insertions, 15 deletions
@@ -213,23 +213,22 @@ int compare_wordlists(word *a, word *b) { return compare_wordlists_literally(a, b); } -void mark_attr_ends(paragraph *sourceform) { - paragraph *p; +void mark_attr_ends(word *words) +{ word *w, *wp; - for (p = sourceform; p; p = p->next) { - wp = NULL; - for (w = p->words; w; w = w->next) { - if (isattr(w->type)) { - int before = (wp && isattr(wp->type) && - sameattr(wp->type, w->type)); - int after = (w->next && isattr(w->next->type) && - sameattr(w->next->type, w->type)); - w->aux |= (before ? - (after ? attr_Always : attr_Last) : - (after ? attr_First : attr_Only)); - } - wp = w; + + wp = NULL; + for (w = words; w; w = w->next) { + if (isattr(w->type)) { + int before = (wp && isattr(wp->type) && + sameattr(wp->type, w->type)); + int after = (w->next && isattr(w->next->type) && + sameattr(w->next->type, w->type)); + w->aux |= (before ? + (after ? attr_Always : attr_Last) : + (after ? attr_First : attr_Only)); } + wp = w; } } |