From 4d3ce3168697232f8d3fae53c2c45bd3aae0f64f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 25 Jun 2014 00:20:19 +0000 Subject: 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. --- read.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'read.c') 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: -- cgit