diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-14 22:58:16 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-14 22:58:16 +0000 |
commit | b0031dfe9b9cc55f4b61c2a1d9e68a6348a85adb (patch) | |
tree | c35e73ede53f08e7ab51e0b49fb27526f690f9be /roff.c | |
parent | 323e3a106a57ad0f1823fa1f87d6bafc7f3097f3 (diff) | |
download | mandoc-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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; |