summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2001-12-14 12:59:34 +0000
committerSimon Tatham <anakin@pobox.com>2001-12-14 12:59:34 +0000
commit1e43991a687d30949a8fb63b21c93ceae1bd7ad0 (patch)
treec609e4621e89d0a2f1f2e08a6b9cc9f3cf4a0cad /input.c
parented0c45541c37742ebf3a8361aeba32c8605483f3 (diff)
downloadhalibut-1e43991a687d30949a8fb63b21c93ceae1bd7ad0.zip
halibut-1e43991a687d30949a8fb63b21c93ceae1bd7ad0.tar.gz
halibut-1e43991a687d30949a8fb63b21c93ceae1bd7ad0.tar.bz2
halibut-1e43991a687d30949a8fb63b21c93ceae1bd7ad0.tar.xz
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]
Diffstat (limited to 'input.c')
-rw-r--r--input.c5
1 files changed, 4 insertions, 1 deletions
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);