summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-02-20 22:40:38 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-02-20 22:40:38 +0000
commitb6009097ae3ad6c24b2fbc8e50140a6bbb5986cd (patch)
treec24a08f6e09cbe73d2c03dab1473fe62fc629d4d /read.c
parentd7e3b62507641810b48e783f4ff9ff51ab2f5215 (diff)
downloadmandoc-b6009097ae3ad6c24b2fbc8e50140a6bbb5986cd.tar.gz
Completely delete all carriage return characters from the input.
No change to messages about them (ignore them right before line feeds, report errors elsewhere). naddy@ found a manual in the wild containing lots of these (ysm(1)), and i can't imagine a situation where dropping them could be problematic.
Diffstat (limited to 'read.c')
-rw-r--r--read.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/read.c b/read.c
index 46cbe254..8a126d51 100644
--- a/read.c
+++ b/read.c
@@ -399,7 +399,8 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
MANDOCERR_CHAR_UNSUPP,
curp, curp->line, pos, "0x%x", c);
i++;
- ln.buf[pos++] = '?';
+ if (c != '\r')
+ ln.buf[pos++] = '?';
continue;
}