summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
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);