From 1e43991a687d30949a8fb63b21c93ceae1bd7ad0 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 14 Dec 2001 12:59:34 +0000 Subject: Buttress was dealing poorly with \r in input files (though not _too_ poorly; mostly it just treated \r as whitespace, and the only time it actually suffered was at the end of a line in a code paragraph). Should now be fixed. [originally from svn r1492] --- input.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'input.c') diff --git a/input.c b/input.c index 4fd8017..a8f076b 100644 --- a/input.c +++ b/input.c @@ -448,8 +448,11 @@ token get_codepar_token(input *in) { ret.pos = cpos; } while (!isnl(c) && c != EOF) { - rdadd(&rs, c); + int c2 = c; c = get(in, &cpos); + /* Discard \r just before \n. */ + if (c2 != 13 || !isnl(c)) + rdadd(&rs, c2); } unget(in, c, &cpos); ret.text = ustrdup(rs.text); -- cgit v1.1