summaryrefslogtreecommitdiffstats
path: root/regress/roff/cond
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-02-06 21:11:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-02-06 21:11:43 +0000
commit386d70b32810ee1090f13d0944310eb93a0ba0fc (patch)
tree3f894d3f306d64ebe183d2f08edc2f8b7ffe8dcc /regress/roff/cond
parent3b603764164fcabf9c701ff02e59f9410c580ae8 (diff)
downloadmandoc-386d70b32810ee1090f13d0944310eb93a0ba0fc.tar.gz
Let roff_getname() end the roff identifier at a tab character
and audit all its callers whether termination is handled correctly. Resulting improvements: * An escape or tab ending the macro name in a macro invocation is discarded, and argument processing is started after it. * An escape or tab ending a name in ".if d" and ".if r" is preserved. * An escape ending a name in ".ds" causes the whole request to be ignored. * A tab ending a name in ".ds" becomes part of the string. * An escape or tab ending a name in ".rm" causes the rest of the line to be ignored. * An escape or tab ending the first name in ".als", ".rn", or ".nr" causes the whole request to be ignored. Kurt Jaeger <pi at FreeBSD> made me aware of https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235456#c0 and in that bug report, comment 0 item (3) is a special case of this class of issues. Yes, the "mh" manual pages are no doubt among the worst on the planet.
Diffstat (limited to 'regress/roff/cond')
-rw-r--r--regress/roff/cond/register.in12
-rw-r--r--regress/roff/cond/register.out_ascii6
-rw-r--r--regress/roff/cond/string.in12
-rw-r--r--regress/roff/cond/string.out_ascii6
4 files changed, 30 insertions, 6 deletions
diff --git a/regress/roff/cond/register.in b/regress/roff/cond/register.in
index 44c53a84..879c573c 100644
--- a/regress/roff/cond/register.in
+++ b/regress/roff/cond/register.in
@@ -1,5 +1,5 @@
-.\" $OpenBSD: register.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $
-.TH REGISTER 1 "May 31, 2015"
+.\" $OpenBSD: register.in,v 1.3 2019/02/06 20:54:28 schwarze Exp $
+.TH REGISTER 1 "February 6, 2019"
.SH NAME
register \- conditional testing whether a register is defined
.SH DESCRIPTION
@@ -10,3 +10,11 @@ register \- conditional testing whether a register is defined
.ie rmyreg now defined
.el OOPS
.if !rmyreg OOPS
+.PP
+identifier + identifier:
+.ie rmyreg myreg is defined
+.el OOPS
+.PP
+escape sequence after identifier:
+.ie rmyreg\(enmyreg is defined
+.el OOPS
diff --git a/regress/roff/cond/register.out_ascii b/regress/roff/cond/register.out_ascii
index acd0f724..0799c5e7 100644
--- a/regress/roff/cond/register.out_ascii
+++ b/regress/roff/cond/register.out_ascii
@@ -9,6 +9,10 @@ DDEESSCCRRIIPPTTIIOONN
not yet defined
now defined
+ identifier + identifier: myreg is defined
+ escape sequence after identifier: -myreg is defined
-OpenBSD May 31, 2015 REGISTER(1)
+
+
+OpenBSD February 6, 2019 REGISTER(1)
diff --git a/regress/roff/cond/string.in b/regress/roff/cond/string.in
index b3bf14b4..273984be 100644
--- a/regress/roff/cond/string.in
+++ b/regress/roff/cond/string.in
@@ -1,5 +1,5 @@
-.\" $OpenBSD: string.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $
-.TH STRING 1 "June 14, 2017"
+.\" $OpenBSD: string.in,v 1.4 2019/02/06 20:54:28 schwarze Exp $
+.TH STRING 1 "February 6, 2019"
.SH NAME
string \- conditional testing whether a string is defined
.SH DESCRIPTION
@@ -32,3 +32,11 @@ mymacval
standard macro is
.ie d PP defined
.el not defined \(em OOPS
+.PP
+identifier and tab:
+.ie d mystr mystr is defined
+.el OOPS
+.PP
+escape sequence after identifier:
+.ie d mystr\(enmystr is defined
+.el OOPS
diff --git a/regress/roff/cond/string.out_ascii b/regress/roff/cond/string.out_ascii
index b5075d21..b01e072a 100644
--- a/regress/roff/cond/string.out_ascii
+++ b/regress/roff/cond/string.out_ascii
@@ -17,6 +17,10 @@ DDEESSCCRRIIPPTTIIOONN
standard macro is defined
+ identifier and tab: mystr is defined
+ escape sequence after identifier: -mystr is defined
-OpenBSD June 14, 2017 STRING(1)
+
+
+OpenBSD February 6, 2019 STRING(1)