summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2012-02-24 18:43:54 +0000
committerSimon Tatham <anakin@pobox.com>2012-02-24 18:43:54 +0000
commitd4c6dfa05ee447a31aaeece63f9b9f062d26e5a8 (patch)
tree602265df117f619816c89a4ca218707bdf93184b
parent9a39e46a7bcc6265a4536770382ab3b61ce42084 (diff)
downloadhalibut-d4c6dfa05ee447a31aaeece63f9b9f062d26e5a8.zip
halibut-d4c6dfa05ee447a31aaeece63f9b9f062d26e5a8.tar.gz
halibut-d4c6dfa05ee447a31aaeece63f9b9f062d26e5a8.tar.bz2
halibut-d4c6dfa05ee447a31aaeece63f9b9f062d26e5a8.tar.xz
Allow macro definitions to be terminated by tok_eof as well as
tok_eop, to prevent Halibut tight-looping when a definition is the last thing in a file. [originally from svn r9419]
-rw-r--r--input.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/input.c b/input.c
index 8556d9f..1410022 100644
--- 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 */