diff options
| author | Simon Tatham <anakin@pobox.com> | 2017-05-15 20:45:02 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2017-05-15 20:45:02 +0100 |
| commit | e12d87eea4df6844d32b564a7840111d8acaf49f (patch) | |
| tree | 6b9152e517458962688dc6acd83e4db23f81b7df | |
| parent | 407cafe5384a606ad5175e26653b261ef2efe460 (diff) | |
| download | halibut-e12d87eea4df6844d32b564a7840111d8acaf49f.zip halibut-e12d87eea4df6844d32b564a7840111d8acaf49f.tar.gz halibut-e12d87eea4df6844d32b564a7840111d8acaf49f.tar.bz2 halibut-e12d87eea4df6844d32b564a7840111d8acaf49f.tar.xz | |
Fix crash in CHM output if a document has no title.
Naturally, after calling the previous commit '1.2', someone had to
instantly find a bug that shows up in the simplest possible example
Halibut invocation :-(
| -rw-r--r-- | bk_html.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1887,8 +1887,9 @@ static void html_backend_common(paragraph *sourceform, keywordlist *keywords, ho_setup_rdstringc(&ho, &rs); ho.hacklimit = 255; - html_words(&ho, topsect->title->words, NOTHING, - NULL, keywords, &conf); + if (topsect->title) + html_words(&ho, topsect->title->words, NOTHING, + NULL, keywords, &conf); rdaddc(&rs, '\0'); chm_title(chm, rs.text); @@ -2027,8 +2028,9 @@ static void html_backend_common(paragraph *sourceform, keywordlist *keywords, "Title="); ho.hacklimit = 255; - html_words(&ho, topsect->title->words, NOTHING, - NULL, keywords, &conf); + if (topsect->title) + html_words(&ho, topsect->title->words, NOTHING, + NULL, keywords, &conf); ho_string(&ho, "\n"); |