diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-06-25 00:20:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-06-25 00:20:19 +0000 |
commit | 4d3ce3168697232f8d3fae53c2c45bd3aae0f64f (patch) | |
tree | 3831ef13f1b6a8bad6a28b23866ab3241323ec67 /roff.c | |
parent | 2d1ca5f3ed692ae735d706aa1bf8360da21eb54b (diff) | |
download | mandoc-4d3ce3168697232f8d3fae53c2c45bd3aae0f64f.tar.gz |
Improve messages related to the roff(7) .so request.
In all these messages, show the filename argument that was passed
to the .so request.
In case of failure, show an additional message reporting the file
and the line number where the failing request was found.
The existing message reporting the reason for the failure -
for example, "Permission denied" - is left in place, unchanged.
Inspired by a question asked by Nick@ after he saw the
confusing old messages that used to be emitted in this area.
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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); } |