diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-06 19:09:00 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-06 19:09:00 +0000 |
commit | f8af9067d4fce04d00f200ac8a73574b0e306f9d (patch) | |
tree | 1a3fc7d34cbd677e9114ee5ce220f5ae3afb1b28 /roff.c | |
parent | feee5d1a235960cd9737d8171d429d9e4acd27cb (diff) | |
download | mandoc-f8af9067d4fce04d00f200ac8a73574b0e306f9d.tar.gz |
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 'roff.c')
-rw-r--r-- | roff.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -542,8 +542,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; } @@ -588,8 +589,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; } @@ -631,8 +632,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 = ""; } @@ -1894,9 +1896,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); @@ -1906,9 +1907,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); |