`style.c' appears to have been around since 1999 and never had
[sgt/halibut] / input.c
diff --git a/input.c b/input.c
index 493449c..1e132b4 100644 (file)
--- a/input.c
+++ b/input.c
@@ -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;
     }