X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/126239bf9360dc2c08c6a206c1eadd0f1d636cdd..0e60e7fec6be3a96f978d3723b9b671bf037f6a0:/input.c diff --git a/input.c b/input.c index 493449c..dc44675 100644 --- a/input.c +++ b/input.c @@ -610,7 +610,7 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx, stack_style = 2, /* \e, \c, \cw */ stack_idx = 4, /* \I, \i, \ii */ stack_hyper = 8, /* \W */ - stack_quote = 16, /* \q */ + stack_quote = 16 /* \q */ } type; word **whptr; /* to restore from \u alternatives */ word **idximplicit; /* to restore from \u alternatives */ @@ -1529,7 +1529,17 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx, } stk_free(parsestk); prev_para_type = par.type; - addpara(par, ret); + /* + * Before we add the paragraph to the output list, we + * should check that there was any text in it at all; there + * might not be if (for example) the paragraph contained + * nothing but an unrecognised command sequence, and if we + * put an empty paragraph on the list it may confuse the + * back ends later on. + */ + if (par.words) { + addpara(par, ret); + } if (t.type == tok_eof) already = TRUE; }