diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-04-12 08:38:28 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-04-12 08:38:28 +0000 |
| commit | e0cce79cf40ca89ded697a27af804355ef9512a3 (patch) | |
| tree | d65ddca5ede51cc4336b7173e0bd2dcbabc94aed /error.c | |
| parent | 2fd0d2ed0c7f939e3f3cd8175395373da4a7718e (diff) | |
| download | halibut-e0cce79cf40ca89ded697a27af804355ef9512a3.zip halibut-e0cce79cf40ca89ded697a27af804355ef9512a3.tar.gz halibut-e0cce79cf40ca89ded697a27af804355ef9512a3.tar.bz2 halibut-e0cce79cf40ca89ded697a27af804355ef9512a3.tar.xz | |
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]
Diffstat (limited to 'error.c')
| -rw-r--r-- | error.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |