-mandoc: invalid.in:7:15: WARNING: invalid escape sequence: \[
+mandoc: invalid.in:7:15: WARNING: invalid escape sequence argument: \[
mandoc: invalid.in:8:14: ERROR: invalid special character: \[%]
mandoc: invalid.in:9:16: ERROR: invalid special character: \[&]
mandoc: invalid.in:10:12: ERROR: invalid special character: \[:]
-mandoc: O1.in:11:6: WARNING: invalid escape sequence: \O5
-mandoc: O1.in:12:7: WARNING: invalid escape sequence: \O(52
+mandoc: O1.in:11:6: WARNING: invalid escape sequence argument: \O5
+mandoc: O1.in:12:7: WARNING: invalid escape sequence argument: \O(52
mandoc: O1.in:13:7: UNSUPP: unsupported escape sequence: \O[5dummy]
-mandoc: O1.in:14:6: WARNING: invalid escape sequence: \O6
+mandoc: O1.in:14:6: WARNING: invalid escape sequence argument: \O6
mandoc: O1.in:15:6: UNSUPP: unsupported escape sequence: \O0
-mandoc: h.in:23:21: WARNING: invalid escape sequence: \h-
+mandoc: h.in:23:21: ERROR: invalid escape argument delimiter: \h-
-.\" $OpenBSD: l.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $
-.Dd $Mdocdate: July 4 2017 $
+.\" $OpenBSD: l.in,v 1.3 2022/06/07 09:51:03 schwarze Exp $
+.Dd $Mdocdate: June 7 2022 $
.Dt ESC-L 1
.Os
.Sh NAME
.br
rounding: >\l'0.26ix'<
.br
-invalid delimiter: >\h-<
+invalid delimiter: >\l-<
rounding: >xxx<
invalid delimiter: ><
-OpenBSD July 4, 2017 OpenBSD
+OpenBSD June 7, 2022 OpenBSD
-mandoc: l.in:23:21: WARNING: invalid escape sequence: \h-
+mandoc: l.in:23:21: ERROR: invalid escape argument delimiter: \l-
-.\" $OpenBSD: mandoc.1,v 1.185 2022/06/05 13:42:49 schwarze Exp $
+.\" $OpenBSD: mandoc.1,v 1.186 2022/06/07 09:51:03 schwarze Exp $
.\"
.\" Copyright (c) 2012, 2014-2022 Ingo Schwarze <schwarze@openbsd.org>
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 5 2022 $
+.Dd $Mdocdate: June 7 2022 $
.Dt MANDOC 1
.Os
.Sh NAME
.Pq mdoc
A new sentence starts in the middle of a text line.
Start it on a new input line to help formatters produce correct spacing.
-.It Sy "invalid escape sequence"
+.It Sy "invalid escape sequence argument"
.Pq roff
-An escape sequence has an invalid opening argument delimiter
-or the argument is of an invalid form.
+The argument of an escape sequence is of an invalid form.
Invalid escape sequences are ignored.
.It Sy "undefined escape, printing literally"
.Pq roff
The name given in a special character escape sequence is not known to
.Nm .
The escape sequence is ignored.
+.It Sy "invalid escape argument delimiter"
+.Pq roff
+An escape sequence that expects a numerical argument
+attempts to employ one of the characters
+.Qq " %&()*+-./0123456789:<=>"
+as an argument delimiter.
+The escape sequence is ignored including the invalid opening delimiter
+and the rest of the argument may appear as output text.
+While various charcters can be used as argument delimiters,
+using the apostrophe-quote character
+.Pq Sq \(aq
+is recommended for readability and robustness.
.El
.Ss Unsupported features
.Bl -ohang
-/* $OpenBSD: mandoc.h,v 1.220 2022/06/05 13:42:49 schwarze Exp $ */
+/* $OpenBSD: mandoc.h,v 1.221 2022/06/07 09:51:03 schwarze Exp $ */
/*
* Copyright (c) 2012-2022 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
MANDOCERR_FI_BLANK, /* blank line in fill mode, using .sp */
MANDOCERR_FI_TAB, /* tab in filled text */
MANDOCERR_EOS, /* new sentence, new line */
- MANDOCERR_ESC_BAD, /* invalid escape sequence: esc */
+ MANDOCERR_ESC_ARG, /* invalid escape sequence argument: esc */
MANDOCERR_ESC_UNDEF, /* undefined escape, printing literally: char */
MANDOCERR_STR_UNDEF, /* undefined string, using "": name */
MANDOCERR_ESC_INCOMPLETE, /* incomplete escape sequence: esc */
MANDOCERR_ESC_BADCHAR, /* invalid special character: esc */
MANDOCERR_ESC_UNKCHAR, /* unknown special character: esc */
+ MANDOCERR_ESC_DELIM, /* invalid escape argument delimiter: esc */
MANDOCERR_UNSUPP, /* ===== start of unsupported features ===== */
-/* $OpenBSD: mandoc_msg.c,v 1.17 2022/06/05 13:42:49 schwarze Exp $ */
+/* $OpenBSD: mandoc_msg.c,v 1.18 2022/06/07 09:51:03 schwarze Exp $ */
/*
* Copyright (c) 2014-2022 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
"blank line in fill mode, using .sp",
"tab in filled text",
"new sentence, new line",
- "invalid escape sequence",
+ "invalid escape sequence argument",
"undefined escape, printing literally",
"undefined string, using \"\"",
"incomplete escape sequence",
"invalid special character",
"unknown special character",
+ "invalid escape argument delimiter",
"unsupported feature",
"input too large",
-/* $OpenBSD: roff_escape.c,v 1.12 2022/06/06 19:22:54 schwarze Exp $ */
+/* $OpenBSD: roff_escape.c,v 1.13 2022/06/07 09:51:03 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012, 2013, 2014, 2015, 2017, 2018, 2020, 2022
* Ingo Schwarze <schwarze@openbsd.org>
if (term == '\b') {
if (strchr("BDHLRSvxNhl", buf[inam]) != NULL &&
strchr(" %&()*+-./0123456789:<=>", buf[iarg]) != NULL) {
+ err = MANDOCERR_ESC_DELIM;
if (rval != ESCAPE_EXPAND)
rval = ESCAPE_ERROR;
if (buf[inam] != 'D') {
case '[':
if (buf[++iarg] == ' ') {
iendarg = iend = iarg + 1;
+ err = MANDOCERR_ESC_ARG;
rval = ESCAPE_ERROR;
goto out;
}
case '2':
case '3':
case '4':
- rval = argl == 1 ? ESCAPE_IGNORE : ESCAPE_ERROR;
+ if (argl == 1)
+ rval = ESCAPE_IGNORE;
+ else {
+ err = MANDOCERR_ESC_ARG;
+ rval = ESCAPE_ERROR;
+ }
break;
case '5':
- rval = buf[iarg - 1] == '[' ? ESCAPE_UNSUPP :
- ESCAPE_ERROR;
+ if (buf[iarg - 1] == '[')
+ rval = ESCAPE_UNSUPP;
+ else {
+ err = MANDOCERR_ESC_ARG;
+ rval = ESCAPE_ERROR;
+ }
break;
default:
+ err = MANDOCERR_ESC_ARG;
rval = ESCAPE_ERROR;
break;
}
switch (rval) {
case ESCAPE_FONT:
rval = mandoc_font(buf + iarg, argl);
+ if (rval == ESCAPE_ERROR)
+ err = MANDOCERR_ESC_ARG;
break;
case ESCAPE_SPECIAL:
*resc = iesc;
switch (rval) {
- case ESCAPE_ERROR:
- if (err == MANDOCERR_OK)
- err = MANDOCERR_ESC_BAD;
- break;
case ESCAPE_UNSUPP:
err = MANDOCERR_ESC_UNSUPP;
break;