aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitd5ba4ec690d23e78c49f85a785f68f1867a04ddc (patch)
tree8ac98a38971caa2953eb6c19f435f4f86428b18e /read.c
parent389ae4bdc6f13542925ab12a12e78336d1ccacea (diff)
downloadmandoc-d5ba4ec690d23e78c49f85a785f68f1867a04ddc.tar.gz
mandoc-d5ba4ec690d23e78c49f85a785f68f1867a04ddc.tar.zst
mandoc-d5ba4ec690d23e78c49f85a785f68f1867a04ddc.zip
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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/read.c b/read.c
index 5f6775e3..69d81f5a 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.126 2015/02/06 16:06:25 schwarze Exp $ */
+/* $Id: read.c,v 1.127 2015/02/20 22:40:38 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;
}