From e0cce79cf40ca89ded697a27af804355ef9512a3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 12 Apr 2005 08:38:28 +0000 Subject: input.c was capable of generating a paragraph structure with no text in it, if the input paragraph contained (say) an unrecognised control command and nothing else. Such paragraphs can confuse back ends later on, so input.c should refrain from generating them. Added a check and a polite error message (just in case the user manages to generate an empty paragraph using otherwise legal syntax). [originally from svn r5629] --- error.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'error.c') diff --git a/error.c b/error.c index 3635f0f..b1e74a1 100644 --- a/error.c +++ b/error.c @@ -278,6 +278,11 @@ static void do_error(int code, va_list ap) { flags = FILEPOS; sfree(sp); break; + case err_emptypara: + fpos = *va_arg(ap, filepos *); + sprintf(error, "found no text in paragraph"); + flags = FILEPOS; + break; case err_whatever: sp = va_arg(ap, char *); vsprintf(error, sp, ap); -- cgit v1.1