Allow macro definitions to be terminated by tok_eof as well as
[sgt/halibut] / 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 */