summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-14 22:58:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-14 22:58:16 +0000
commitb0031dfe9b9cc55f4b61c2a1d9e68a6348a85adb (patch)
treec35e73ede53f08e7ab51e0b49fb27526f690f9be /roff.c
parent323e3a106a57ad0f1823fa1f87d6bafc7f3097f3 (diff)
downloadmandoc-b0031dfe9b9cc55f4b61c2a1d9e68a6348a85adb.tar.gz
downgrade ".so with absolute path" from FATAL to ERROR;
allows to get rid of ROFF_ERR
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index d0ddc4a3..1b106da8 100644
--- a/roff.c
+++ b/roff.c
@@ -2103,7 +2103,7 @@ roff_tr(ROFF_ARGS)
static enum rofferr
roff_so(ROFF_ARGS)
{
- char *name;
+ char *name, *cp;
name = buf->buf + pos;
mandoc_vmsg(MANDOCERR_SO, r->parse, ln, ppos, "so %s", name);
@@ -2118,7 +2118,12 @@ roff_so(ROFF_ARGS)
if (*name == '/' || strstr(name, "../") || strstr(name, "/..")) {
mandoc_vmsg(MANDOCERR_SO_PATH, r->parse, ln, ppos,
".so %s", name);
- return(ROFF_ERR);
+ buf->sz = mandoc_asprintf(&cp,
+ ".sp\nSee the file %s.\n.sp", name) + 1;
+ free(buf->buf);
+ buf->buf = cp;
+ *offs = 0;
+ return(ROFF_REPARSE);
}
*offs = pos;