summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mandoc.h3
-rw-r--r--read.c7
-rw-r--r--roff.c7
3 files changed, 12 insertions, 5 deletions
diff --git a/mandoc.h b/mandoc.h
index 5627d4d8..5189e234 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -162,7 +162,8 @@ enum mandocerr {
MANDOCERR_SYNTARGVCOUNT, /* argument count wrong, violates syntax */
MANDOCERR_SYNTCHILD, /* child violates parent syntax */
MANDOCERR_SYNTARGCOUNT, /* argument count wrong, violates syntax */
- MANDOCERR_SOPATH, /* NOT IMPLEMENTED: .so with absolute path or ".." */
+ MANDOCERR_SO_PATH, /* NOT IMPLEMENTED: .so with absolute path or ".." */
+ MANDOCERR_SO_FAIL, /* .so request failed */
MANDOCERR_NODOCPROLOG, /* no document prologue */
MANDOCERR_MEM, /* static buffer exhausted */
diff --git a/read.c b/read.c
index 3b6242cf..e5c75a7c 100644
--- a/read.c
+++ b/read.c
@@ -206,6 +206,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"child violates parent syntax",
"argument count wrong, violates syntax",
"NOT IMPLEMENTED: .so with absolute path or \"..\"",
+ ".so request failed",
"no document prologue",
"static buffer exhausted",
@@ -506,8 +507,12 @@ rerun:
if (curp->secondary)
curp->secondary->sz -= pos + 1;
mparse_readfd(curp, -1, ln.buf + of);
- if (MANDOCLEVEL_FATAL <= curp->file_status)
+ if (MANDOCLEVEL_FATAL <= curp->file_status) {
+ mandoc_vmsg(MANDOCERR_SO_FAIL,
+ curp, curp->line, pos,
+ ".so %s", ln.buf + of);
break;
+ }
pos = 0;
continue;
default:
diff --git a/roff.c b/roff.c
index eed432e4..e29df8fd 100644
--- a/roff.c
+++ b/roff.c
@@ -1938,7 +1938,8 @@ roff_so(ROFF_ARGS)
{
char *name;
- mandoc_msg(MANDOCERR_SO, r->parse, ln, ppos, NULL);
+ name = *bufp + pos;
+ mandoc_vmsg(MANDOCERR_SO, r->parse, ln, ppos, ".so %s", name);
/*
* Handle `so'. Be EXTREMELY careful, as we shouldn't be
@@ -1947,9 +1948,9 @@ roff_so(ROFF_ARGS)
* or using absolute paths.
*/
- name = *bufp + pos;
if ('/' == *name || strstr(name, "../") || strstr(name, "/..")) {
- mandoc_msg(MANDOCERR_SOPATH, r->parse, ln, pos, NULL);
+ mandoc_vmsg(MANDOCERR_SO_PATH, r->parse, ln, ppos,
+ ".so %s", name);
return(ROFF_ERR);
}