Allow macro definitions to be terminated by tok_eof as well as
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 24 Feb 2012 18:43:54 +0000 (18:43 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 24 Feb 2012 18:43:54 +0000 (18:43 +0000)
tok_eop, to prevent Halibut tight-looping when a definition is the
last thing in a file.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@9419 cda61777-01e9-0310-a592-d414129be87e

input.c

diff --git a/input.c b/input.c
index 8556d9f..1410022 100644 (file)
--- a/input.c
+++ b/input.c
@@ -978,7 +978,8 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx,
                            rdadd(&macrotext, L'\n');
                        rdadds(&macrotext, t.text);
                        dtor(t), t = get_token(in);
-                       if (t.type == tok_eop) break;
+                       if (t.type == tok_eop || t.type == tok_eof)
+                            break;
                    }
                    macrodef(macros, rs.text, macrotext.text, fp);
                    continue;          /* next paragraph */