neither supports tbl(7) nor eqn(7) input.
If an input file contains such code anyway, tell the user
rather than failing an assert(3)ion.
Fixing a crash reported by Bjarni Ingi Gislason <bjarniig at rhi dot hi dot is>
in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901636 which the
Debian maintainer of mandoc, Michael at Stapelberg dot ch, forwarded to me.
-.\" $OpenBSD: mandoc.1,v 1.177 2021/06/28 19:49:57 schwarze Exp $
+.\" $OpenBSD: mandoc.1,v 1.178 2021/07/04 15:38:08 schwarze Exp $
.\"
.\" Copyright (c) 2012, 2014-2021 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 28 2021 $
+.Dd $Mdocdate: July 4 2021 $
.Dt MANDOC 1
.Os
.Sh NAME
macro or of an undefined macro.
The macro is ignored, and its arguments are handled
as if they were a text line.
+.It Sy "skipping tbl in -Tman mode"
+.Pq mdoc , tbl
+An input file contains the
+.Ic \&TS
+macro.
+This message is only generated in
+.Fl T Cm man
+output mode, where
+.Xr tbl 7
+input is not supported.
+.It Sy "skipping eqn in -Tman mode"
+.Pq mdoc , eqn
+An input file contains the
+.Ic \&EQ
+macro.
+This message is only generated in
+.Fl T Cm man
+output mode, where
+.Xr eqn 7
+input is not supported.
.El
.Ss Bad command line arguments
.Bl -ohang
-/* $OpenBSD: mandoc.h,v 1.213 2021/06/27 17:57:13 schwarze Exp $ */
+/* $OpenBSD: mandoc.h,v 1.214 2021/07/04 15:38:08 schwarze Exp $ */
/*
- * Copyright (c) 2012-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2012-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
MANDOCERR_TBLOPT_EQN, /* eqn delim option in tbl: arg */
MANDOCERR_TBLLAYOUT_MOD, /* unsupported tbl layout modifier: m */
MANDOCERR_TBLMACRO, /* ignoring macro in table: macro */
+ MANDOCERR_TBL_TMAN, /* skipping tbl in -Tman mode */
+ MANDOCERR_EQN_TMAN, /* skipping eqn in -Tman mode */
MANDOCERR_BADARG, /* ===== start of bad invocations ===== */
-/* $OpenBSD: mandoc_msg.c,v 1.12 2021/06/27 17:57:13 schwarze Exp $ */
+/* $OpenBSD: mandoc_msg.c,v 1.13 2021/07/04 15:38:09 schwarze Exp $ */
/*
- * Copyright (c) 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
"eqn delim option in tbl",
"unsupported tbl layout modifier",
"ignoring macro in table",
+ "skipping tbl in -Tman mode",
+ "skipping eqn in -Tman mode",
/* bad command line arguments */
NULL,
-/* $OpenBSD: mdoc_man.c,v 1.134 2020/02/27 01:25:57 schwarze Exp $ */
+/* $OpenBSD: mdoc_man.c,v 1.135 2021/07/04 15:38:09 schwarze Exp $ */
/*
- * Copyright (c) 2011-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
do_sub = 1;
n->flags &= ~NODE_ENDED;
- if (n->type == ROFFT_TEXT) {
+ switch (n->type) {
+ case ROFFT_EQN:
+ case ROFFT_TBL:
+ mandoc_msg(n->type == ROFFT_EQN ? MANDOCERR_EQN_TMAN :
+ MANDOCERR_TBL_TMAN, n->line, n->pos, NULL);
+ outflags |= MMAN_PP | MMAN_sp | MMAN_nl;
+ print_word("The");
+ print_line(".B \\-T man", MMAN_nl);
+ print_word("output mode does not support");
+ print_word(n->type == ROFFT_EQN ? "eqn(7)" : "tbl(7)");
+ print_word("input.");
+ outflags |= MMAN_PP | MMAN_sp | MMAN_nl;
+ return;
+ case ROFFT_TEXT:
/*
* Make sure that we don't happen to start with a
* control character at the start of a line.
outflags &= ~(MMAN_spc | MMAN_spc_force);
else if (outflags & MMAN_Sm)
outflags |= MMAN_spc;
- } else if (n->tok < ROFF_MAX) {
- (*roff_man_acts[n->tok])(meta, n);
- return;
- } else {
- /*
- * Conditionally run the pre-node action handler for a
- * node.
- */
+ break;
+ default:
+ if (n->tok < ROFF_MAX) {
+ (*roff_man_acts[n->tok])(meta, n);
+ return;
+ }
act = mdoc_man_act(n->tok);
cond = act->cond == NULL || (*act->cond)(meta, n);
if (cond && act->pre != NULL &&
(n->end == ENDBODY_NOT || n->child != NULL))
do_sub = (*act->pre)(meta, n);
+ break;
}
/*