aboutsummaryrefslogtreecommitdiffstatshomepage
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
commite402ce0a4d1def17586b4c8b5d769063e5e841b9 (patch)
tree395c308cb49c03bfbca725e1e0fc7a0d1d509908 /roff.c
parenta75cd602ebfaf527c83177aa31df55e03e2e854e (diff)
downloadmandoc-e402ce0a4d1def17586b4c8b5d769063e5e841b9.tar.gz
mandoc-e402ce0a4d1def17586b4c8b5d769063e5e841b9.tar.zst
mandoc-e402ce0a4d1def17586b4c8b5d769063e5e841b9.zip
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.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/roff.c b/roff.c
index ab1cbfea..8721a680 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.248 2015/01/07 12:19:46 schwarze Exp $ */
+/* $Id: roff.c,v 1.249 2015/01/14 22:58:16 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;