source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: The .AT, .DT, and .UC macros are allowed inside next-line scope
Date: Wed, 27 Apr 2022 12:11:58 -0500 (EST)	[thread overview]
Message-ID: <33651957255ad3bd@mandoc.bsd.lv> (raw)

Log Message:
-----------
The .AT, .DT, and .UC macros are allowed inside next-line scope
and never produce output at the place of their invocation.

Minibugs found while investigating unrelated afl(1) reports from tb@.

Modified Files:
--------------
    mandoc:
        man_macro.c
        man_term.c
    mandoc/regress/man:
        Makefile

Added Files:
-----------
    mandoc/regress/man/AT:
        Makefile
        basic.in
        basic.out_ascii
    mandoc/regress/man/DT:
        Makefile
        basic.in
        basic.out_ascii
    mandoc/regress/man/UC:
        Makefile
        basic.in
        basic.out_ascii

Revision Data
-------------
--- /dev/null
+++ regress/man/AT/basic.out_ascii
@@ -0,0 +1,9 @@
+AT-BASIC(1)                 General Commands Manual                AT-BASIC(1)
+
+N\bNA\bAM\bME\bE
+       AT-basic - the AT&T footer macro
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       initial text b\bbo\bol\bld\bd t\bte\bex\bxt\bt final text
+
+7th Edition                     April 27, 2022                     AT-BASIC(1)
--- /dev/null
+++ regress/man/AT/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2022/04/27 17:04:15 schwarze Exp $
+
+REGRESS_TARGETS	 = basic
+
+.include <bsd.regress.mk>
--- /dev/null
+++ regress/man/AT/basic.in
@@ -0,0 +1,10 @@
+.\" $OpenBSD: basic.in,v 1.1 2022/04/27 17:04:15 schwarze Exp $
+.TH AT-BASIC 1 "April 27, 2022"
+.SH NAME
+AT-basic \- the AT&T footer macro
+.SH DESCRIPTION
+initial text
+.B
+.AT
+bold text
+final text
Index: man_macro.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_macro.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -Lman_macro.c -Lman_macro.c -u -p -r1.147 -r1.148
--- man_macro.c
+++ man_macro.c
@@ -68,10 +68,10 @@ static const struct man_macro man_macros
 	{ in_line_eoln, 0 }, /* RI */
 	{ blk_close, MAN_XSCOPE }, /* RE */
 	{ blk_exp, MAN_XSCOPE }, /* RS */
-	{ in_line_eoln, 0 }, /* DT */
-	{ in_line_eoln, 0 }, /* UC */
+	{ in_line_eoln, MAN_NSCOPED }, /* DT */
+	{ in_line_eoln, MAN_NSCOPED }, /* UC */
 	{ in_line_eoln, MAN_NSCOPED }, /* PD */
-	{ in_line_eoln, 0 }, /* AT */
+	{ in_line_eoln, MAN_NSCOPED }, /* AT */
 	{ in_line_eoln, MAN_NSCOPED }, /* in */
 	{ blk_imp, MAN_XSCOPE }, /* SY */
 	{ blk_close, MAN_XSCOPE }, /* YS */
Index: man_term.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_term.c,v
retrieving revision 1.236
retrieving revision 1.237
diff -Lman_term.c -Lman_term.c -u -p -r1.236 -r1.237
--- man_term.c
+++ man_term.c
@@ -1,6 +1,6 @@
 /* $Id$ */
 /*
- * Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2015,2017-2020,2022 Ingo Schwarze <schwarze@openbsd.org>
  * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -121,10 +121,10 @@ static const struct man_term_act man_ter
 	{ pre_alternate, NULL, 0 }, /* RI */
 	{ NULL, NULL, 0 }, /* RE */
 	{ pre_RS, post_RS, 0 }, /* RS */
-	{ pre_DT, NULL, 0 }, /* DT */
+	{ pre_DT, NULL, MAN_NOTEXT }, /* DT */
 	{ pre_ign, NULL, MAN_NOTEXT }, /* UC */
 	{ pre_PD, NULL, MAN_NOTEXT }, /* PD */
-	{ pre_ign, NULL, 0 }, /* AT */
+	{ pre_ign, NULL, MAN_NOTEXT }, /* AT */
 	{ pre_in, NULL, MAN_NOTEXT }, /* in */
 	{ pre_SY, post_SY, 0 }, /* SY */
 	{ NULL, NULL, 0 }, /* YS */
--- /dev/null
+++ regress/man/DT/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2022/04/27 17:04:15 schwarze Exp $
+
+REGRESS_TARGETS	 = basic
+
+.include <bsd.regress.mk>
--- /dev/null
+++ regress/man/DT/basic.in
@@ -0,0 +1,22 @@
+.\" $OpenBSD: basic.in,v 1.1 2022/04/27 17:04:15 schwarze Exp $
+.TH DT-BASIC 1 "April 27, 2022"
+.SH NAME
+DT-basic \- restore the default tabulator positions
+.SH DESCRIPTION
+.nf
+Default tabs are every five columns:
+1234 1234 1234 1234 1234
+one	two	three	four
+.PP
+Custom tabs: column 6, then every 8 columns:
+12345 1234567 1234567 1234567
+.ta 6n T 8n
+one	two	three	four
+.PP
+.B
+.DT
+bold text
+.PP
+Back to the default:
+1234 1234 1234 1234 1234
+one	two	three	four
--- /dev/null
+++ regress/man/DT/basic.out_ascii
@@ -0,0 +1,21 @@
+DT-BASIC(1)                 General Commands Manual                DT-BASIC(1)
+
+N\bNA\bAM\bME\bE
+       DT-basic - restore the default tabulator positions
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       Default tabs are every five columns:
+       1234 1234 1234 1234 1234
+       one  two  three     four
+
+       Custom tabs: column 6, then every 8 columns:
+       12345 1234567 1234567 1234567
+       one   two     three   four
+
+       b\bbo\bol\bld\bd t\bte\bex\bxt\bt
+
+       Back to the default:
+       1234 1234 1234 1234 1234
+       one  two  three     four
+
+OpenBSD                         April 27, 2022                     DT-BASIC(1)
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lregress/man/Makefile -Lregress/man/Makefile -u -p -r1.3 -r1.4
--- regress/man/Makefile
+++ regress/man/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.19 2019/01/05 21:13:55 schwarze Exp $
+# $OpenBSD: Makefile,v 1.20 2022/04/27 17:04:15 schwarze Exp $
 
-SUBDIR = B BI EX HP IP MT OP PD PP RS SH SS SY TH TP TS UR nf blank
+SUBDIR = AT B BI DT EX HP IP MT OP PD PP RS SH SS SY TH TP TS UC UR nf blank
 
 .include "../Makefile.sub"
 .include <bsd.subdir.mk>
--- /dev/null
+++ regress/man/UC/basic.in
@@ -0,0 +1,10 @@
+.\" $OpenBSD: basic.in,v 1.1 2022/04/27 17:04:15 schwarze Exp $
+.TH UC-BASIC 1 "April 27, 2022"
+.SH NAME
+UC-basic \- the University of California footer macro
+.SH DESCRIPTION
+initial text
+.B
+.UC
+bold text
+final text
--- /dev/null
+++ regress/man/UC/basic.out_ascii
@@ -0,0 +1,9 @@
+UC-BASIC(1)                 General Commands Manual                UC-BASIC(1)
+
+N\bNA\bAM\bME\bE
+       UC-basic - the University of California footer macro
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       initial text b\bbo\bol\bld\bd t\bte\bex\bxt\bt final text
+
+3rd Berkeley Distribution       April 27, 2022                     UC-BASIC(1)
--- /dev/null
+++ regress/man/UC/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2022/04/27 17:04:15 schwarze Exp $
+
+REGRESS_TARGETS	 = basic
+
+.include <bsd.regress.mk>
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


                 reply	other threads:[~2022-04-27 17:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33651957255ad3bd@mandoc.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    --subject='Re: mandoc: The .AT, .DT, and .UC macros are allowed inside next-line scope' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).