diff options
author | 2010-11-28 19:35:33 +0000 | |
---|---|---|
committer | 2010-11-28 19:35:33 +0000 | |
commit | 244831508d638784bdc961486902ea65fae18977 (patch) | |
tree | 554e3d927f3f8250c3b9c7b416759a190f7ee21b /usr.bin/mandoc/man.c | |
parent | Update example filterset to include a basic IPv6 filterset. (diff) | |
download | wireguard-openbsd-244831508d638784bdc961486902ea65fae18977.tar.xz wireguard-openbsd-244831508d638784bdc961486902ea65fae18977.zip |
To avoid FATAL errors, we have been parsing and ignoring the roff
requests .am, .ami, .am1, .dei, and .rm for a long time.
Since ignoring them can (rarely) cause information loss and serious
misformatting, throw an ERROR: NOT IMPLEMENTED when finding them.
Implementing them would not be too difficult, but they are so rare
in practice that i can find better use for my time right now.
In this context,
- Put the string "NOT IMPLEMENTED" into two other error messages
as well, to distinguish them from those caused by broken input.
- Print the string "unknown macro" once, not twice in the error message
associated with MANDOCERR_MACRO, and begin printing the buffer at the
point where the unknown macro really is, not at the start of line.
Diffstat (limited to 'usr.bin/mandoc/man.c')
-rw-r--r-- | usr.bin/mandoc/man.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index 9f43b074228..b032524de7b 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.43 2010/10/16 20:49:37 schwarze Exp $ */ +/* $Id: man.c,v 1.44 2010/11/28 19:35:33 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -490,9 +490,7 @@ man_pmacro(struct man *m, int ln, char *buf, int offs) tok = (j > 0 && j < 4) ? man_hash_find(mac) : MAN_MAX; if (MAN_MAX == tok) { - man_vmsg(m, MANDOCERR_MACRO, ln, ppos, - "unknown macro: %s%s", - buf, strlen(buf) > 3 ? "..." : ""); + man_vmsg(m, MANDOCERR_MACRO, ln, ppos, "%s", buf + ppos - 1); return(1); } |