summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-07-06 19:08:58 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-07-06 19:08:58 +0000
commita9844262036e028323f7d11f70991b9a54447ec4 (patch)
treed20ae2fc8759280ad3aecc86197d981efcfff5ce /usr.bin/mandoc/roff.c
parent656c11bd9c6a0d01822385b9ea5acafa9ba53171 (diff)
Clean up messages related to plain text and to escape sequences.
* Mention invalid escape sequences and string names, and fallbacks. * Hierarchical naming.
Diffstat (limited to 'usr.bin/mandoc/roff.c')
-rw-r--r--usr.bin/mandoc/roff.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index 8f6e188250e..ceec0f7a274 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.91 2014/07/06 18:46:51 schwarze Exp $ */
+/* $Id: roff.c,v 1.92 2014/07/06 19:08:56 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -538,8 +538,9 @@ roff_res(struct roff *r, char **bufp, size_t *szp, int ln, int pos)
break;
default:
if (ESCAPE_ERROR == mandoc_escape(&cp, NULL, NULL))
- mandoc_msg(MANDOCERR_BADESCAPE, r->parse,
- ln, (int)(stesc - *bufp), NULL);
+ mandoc_vmsg(MANDOCERR_ESC_BAD,
+ r->parse, ln, (int)(stesc - *bufp),
+ "%.*s", (int)(cp - stesc), stesc);
continue;
}
@@ -584,8 +585,8 @@ roff_res(struct roff *r, char **bufp, size_t *szp, int ln, int pos)
arg_complete = 1;
for (naml = 0; 0 == maxl || naml < maxl; naml++, cp++) {
if ('\0' == *cp) {
- mandoc_msg(MANDOCERR_BADESCAPE, r->parse,
- ln, (int)(stesc - *bufp), NULL);
+ mandoc_msg(MANDOCERR_ESC_BAD, r->parse,
+ ln, (int)(stesc - *bufp), stesc);
arg_complete = 0;
break;
}
@@ -627,8 +628,9 @@ roff_res(struct roff *r, char **bufp, size_t *szp, int ln, int pos)
}
if (NULL == res) {
- mandoc_msg(MANDOCERR_BADESCAPE, r->parse,
- ln, (int)(stesc - *bufp), NULL);
+ mandoc_vmsg(MANDOCERR_STR_UNDEF,
+ r->parse, ln, (int)(stesc - *bufp),
+ "%.*s", (int)naml, stnam);
res = "";
}
@@ -1890,9 +1892,8 @@ roff_tr(ROFF_ARGS)
if ('\\' == *first) {
esc = mandoc_escape(&p, NULL, NULL);
if (ESCAPE_ERROR == esc) {
- mandoc_msg(MANDOCERR_BADESCAPE,
- r->parse, ln,
- (int)(p - *bufp), NULL);
+ mandoc_msg(MANDOCERR_ESC_BAD, r->parse,
+ ln, (int)(p - *bufp), first);
return(ROFF_IGN);
}
fsz = (size_t)(p - first);
@@ -1902,9 +1903,8 @@ roff_tr(ROFF_ARGS)
if ('\\' == *second) {
esc = mandoc_escape(&p, NULL, NULL);
if (ESCAPE_ERROR == esc) {
- mandoc_msg(MANDOCERR_BADESCAPE,
- r->parse, ln,
- (int)(p - *bufp), NULL);
+ mandoc_msg(MANDOCERR_ESC_BAD, r->parse,
+ ln, (int)(p - *bufp), second);
return(ROFF_IGN);
}
ssz = (size_t)(p - second);