diff options
author | 2014-06-25 00:20:19 +0000 | |
---|---|---|
committer | 2014-06-25 00:20:19 +0000 | |
commit | 0b6903db7750adfcd88f388a0196037f91e474c6 (patch) | |
tree | 74a7bb636324f8fbc42a2c5baf7d30fcf31df1cf /read.c | |
parent | ac2e8ee3f16b454077019e9f59ae2ff011411ae5 (diff) | |
download | mandoc-0b6903db7750adfcd88f388a0196037f91e474c6.tar.gz mandoc-0b6903db7750adfcd88f388a0196037f91e474c6.tar.zst mandoc-0b6903db7750adfcd88f388a0196037f91e474c6.zip |
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 'read.c')
-rw-r--r-- | read.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.51 2014/06/21 22:24:01 schwarze Exp $ */ +/* $Id: read.c,v 1.52 2014/06/25 00:20:19 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -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: |