summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-14 08:11:06 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-14 08:44:15 +0100
commitc00d1c3b6003dbbb72439de0ebdb4a93c8763f65 (patch)
tree548ad96cb72398c69625ec670beeb90c0566a15d
parent94831068fb5573b1ebdb9def9c2ad09f0694d45c (diff)
downloadhalibut-c00d1c3b6003dbbb72439de0ebdb4a93c8763f65.zip
halibut-c00d1c3b6003dbbb72439de0ebdb4a93c8763f65.tar.gz
halibut-c00d1c3b6003dbbb72439de0ebdb4a93c8763f65.tar.bz2
halibut-c00d1c3b6003dbbb72439de0ebdb4a93c8763f65.tar.xz
Add missing initialisations in the 'word' structure.
The 'breaks' and 'aux' fields were filled in rather inconsistently at various places where a word is created - especially the outlying ones that manufacture pieces of document during internal processing of contents, index, bibliography, cross-references etc rather than directly from the input file. This has never led to any user-visible behaviour change that I've noticed, but it made a lot of annoying noise in the valgrind output, which got in my way last week when I was trying to debug the CHM generation.
-rw-r--r--biblio.c2
-rw-r--r--bk_paper.c1
-rw-r--r--contents.c4
-rw-r--r--keywords.c2
4 files changed, 9 insertions, 0 deletions
diff --git a/biblio.c b/biblio.c
index f4c5413..823588c 100644
--- a/biblio.c
+++ b/biblio.c
@@ -95,8 +95,10 @@ void gen_citations(paragraph *source, keywordlist *kl) {
word *wd = smalloc(sizeof(word));
wd->text = gentext(++bibnum);
wd->type = word_Normal;
+ wd->breaks = FALSE;
wd->alt = NULL;
wd->next = NULL;
+ wd->aux = 0;
kw->text = wd;
}
para->kwtext = kw->text;
diff --git a/bk_paper.c b/bk_paper.c
index 1ec6bc8..7b7960e 100644
--- a/bk_paper.c
+++ b/bk_paper.c
@@ -2562,6 +2562,7 @@ static para_data *code_paragraph(int indent, word *words, paper_conf *conf)
memcpy(w->text, start, (t-start) * sizeof(wchar_t));
w->text[t-start] = '\0';
w->breaks = FALSE;
+ w->aux = 0;
if (ltail)
ltail->next = w;
diff --git a/contents.c b/contents.c
index 1649212..e8b1afc 100644
--- a/contents.c
+++ b/contents.c
@@ -53,6 +53,8 @@ static void dotext(word ***wret, wchar_t *text) {
mnewword->type = word_Normal;
mnewword->alt = NULL;
mnewword->next = NULL;
+ mnewword->breaks = FALSE;
+ mnewword->aux = 0;
**wret = mnewword;
*wret = &mnewword->next;
}
@@ -63,6 +65,8 @@ static void dospace(word ***wret) {
mnewword->type = word_WhiteSpace;
mnewword->alt = NULL;
mnewword->next = NULL;
+ mnewword->breaks = FALSE;
+ mnewword->aux = 0;
**wret = mnewword;
*wret = &mnewword->next;
}
diff --git a/keywords.c b/keywords.c
index 14aa6bd..c117346 100644
--- a/keywords.c
+++ b/keywords.c
@@ -139,6 +139,8 @@ void subst_keywords(paragraph *source, keywordlist *kl) {
close->alt = NULL;
close->type = word_XrefEnd;
close->fpos = ptr->fpos;
+ close->breaks = FALSE;
+ close->aux = 0;
close->next = ptr->next;
ptr->next = subst;