summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-15 20:45:02 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-15 20:45:02 +0100
commite12d87eea4df6844d32b564a7840111d8acaf49f (patch)
tree6b9152e517458962688dc6acd83e4db23f81b7df
parent407cafe5384a606ad5175e26653b261ef2efe460 (diff)
downloadhalibut-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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/bk_html.c b/bk_html.c
index 784e3ca..f6b7f4b 100644
--- a/bk_html.c
+++ b/bk_html.c
@@ -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");