diff options
| author | Simon Tatham <anakin@pobox.com> | 2003-01-09 12:04:01 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2003-01-09 12:04:01 +0000 |
| commit | 6576379028db35e575cb6c855396706bad363521 (patch) | |
| tree | 3da5356a228ca0c11b37ec38ac1dc5c35cf6e6e0 | |
| parent | 231259df4aaef127e3d409b7fedd52ba79cdb656 (diff) | |
| download | halibut-6576379028db35e575cb6c855396706bad363521.zip halibut-6576379028db35e575cb6c855396706bad363521.tar.gz halibut-6576379028db35e575cb6c855396706bad363521.tar.bz2 halibut-6576379028db35e575cb6c855396706bad363521.tar.xz | |
WinHelp backend segfaults when it finds a nonexistent cross-
reference. (The broken link will already have been reported in the
mid-end, but this won't inhibit output generation, so the onus is
still on us to at the very least not go *crash*.)
[originally from svn r2507]
| -rw-r--r-- | bk_whlp.c | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -479,22 +479,25 @@ static void whlp_mkparagraph(struct bk_whlp_state *state, case word_LowerXref: if (subsidiary) break; /* disabled in subsidiary bits */ kwl = kw_lookup(state->keywords, text->text); - assert(xref_target == NULL); - if (kwl->para->type == para_NumberedList) { - break; /* don't xref to numbered list items */ - } else if (kwl->para->type == para_BiblioCited) { - /* - * An xref to a bibliography item jumps to the section - * containing it. - */ - if (kwl->para->parent) - xref_target = kwl->para->parent; - else - break; - } else { - xref_target = kwl->para; - } - whlp_start_hyperlink(state->h, (WHLP_TOPIC)xref_target->private_data); + assert(xref_target == NULL); + if (kwl) { + if (kwl->para->type == para_NumberedList) { + break; /* don't xref to numbered list items */ + } else if (kwl->para->type == para_BiblioCited) { + /* + * An xref to a bibliography item jumps to the section + * containing it. + */ + if (kwl->para->parent) + xref_target = kwl->para->parent; + else + break; + } else { + xref_target = kwl->para; + } + whlp_start_hyperlink(state->h, + (WHLP_TOPIC)xref_target->private_data); + } break; case word_XrefEnd: |