aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/regress/roff/de/tab.in
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
commit3c72c09b0b46063f51691bedeabc69413194fb61 (patch)
tree5aed0c39c8ce206d5efe99b45ec9079467b23123 /regress/roff/de/tab.in
parent50896331bceb2d7578b7d71bbe8cc4a4d8452fc8 (diff)
downloadmandoc-3c72c09b0b46063f51691bedeabc69413194fb61.tar.gz
mandoc-3c72c09b0b46063f51691bedeabc69413194fb61.tar.zst
mandoc-3c72c09b0b46063f51691bedeabc69413194fb61.zip
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/de/tab.in')
-rw-r--r--regress/roff/de/tab.in41
1 files changed, 41 insertions, 0 deletions
diff --git a/regress/roff/de/tab.in b/regress/roff/de/tab.in
new file mode 100644
index 00000000..5f85fe21
--- /dev/null
+++ b/regress/roff/de/tab.in
@@ -0,0 +1,41 @@
+.\" $OpenBSD: tab.in,v 1.1 2019/02/06 20:54:28 schwarze Exp $
+.Dd $Mdocdate: February 6 2019 $
+.Dt DE-TAB 1
+.Os
+.Sh NAME
+.Nm de-tab
+.Nd tab characters in macro definition lines
+.Sh DESCRIPTION
+.de test1 ignored
+testval \\$1;\\$2
+..
+no argument:
+.test1
+.br
+argument after_tab:
+.test1 after_tab
+.br
+argument after_tab_and_space:
+.test1 after_tab_and_space
+.br
+argument after_two_tabs:
+.test1 after_two_tabs
+.br
+argument after_tab_tab_space:
+.test1 after_tab_tab_space
+.Ss End marker
+.de test2 endm ignored
+testval \\$1;\\$2
+.endm
+no argument:
+.test2
+.br
+argument after_tab:
+.test2 after_tab
+.Ss Removal
+.rm test1 test2
+macro test1 is gone:
+.test1
+.br
+macro test2 still exists:
+.test2