diff options
author | 2015-04-06 22:06:06 +0000 | |
---|---|---|
committer | 2015-04-06 22:06:06 +0000 | |
commit | 54421b683964fd682769c81f7939b7023ddfc927 (patch) | |
tree | bcc657c5f7dd736e4a3458acf50f25d3eb1896f1 | |
parent | Moar comments !! Explain what's going on during install / upgrade. (diff) | |
download | wireguard-openbsd-54421b683964fd682769c81f7939b7023ddfc927.tar.xz wireguard-openbsd-54421b683964fd682769c81f7939b7023ddfc927.zip |
Do not mistreat empty arguments to font alternating macros
as vertical spacing requests. Bug found with xmahjongg(6).
-rw-r--r-- | regress/usr.bin/mandoc/man/BI/Makefile | 4 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/BI/emptyargs.in | 10 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/BI/emptyargs.out_ascii | 18 | ||||
-rw-r--r-- | usr.bin/mandoc/man_term.c | 7 |
4 files changed, 35 insertions, 4 deletions
diff --git a/regress/usr.bin/mandoc/man/BI/Makefile b/regress/usr.bin/mandoc/man/BI/Makefile index c8a65412887..b23aeeadb65 100644 --- a/regress/usr.bin/mandoc/man/BI/Makefile +++ b/regress/usr.bin/mandoc/man/BI/Makefile @@ -1,5 +1,5 @@ -# $OpenBSD: Makefile,v 1.2 2011/11/17 16:28:45 schwarze Exp $ +# $OpenBSD: Makefile,v 1.3 2015/04/06 22:06:06 schwarze Exp $ -REGRESS_TARGETS=literal +REGRESS_TARGETS = emptyargs literal .include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/man/BI/emptyargs.in b/regress/usr.bin/mandoc/man/BI/emptyargs.in new file mode 100644 index 00000000000..acbf4986541 --- /dev/null +++ b/regress/usr.bin/mandoc/man/BI/emptyargs.in @@ -0,0 +1,10 @@ +.TH BI-EMPTYARGS 1 "April 6, 2015" OpenBSD +.SH NAME +BI-emptyargs \- empty arguments to font alternation macros +.SH DESCRIPTION +leading text +.TP 6n +.BI bold italic "" "" +.BI bold "" "" italic +.PP +trailing text diff --git a/regress/usr.bin/mandoc/man/BI/emptyargs.out_ascii b/regress/usr.bin/mandoc/man/BI/emptyargs.out_ascii new file mode 100644 index 00000000000..3469b7e0c1a --- /dev/null +++ b/regress/usr.bin/mandoc/man/BI/emptyargs.out_ascii @@ -0,0 +1,18 @@ +BI-EMPTYARGS(1) General Commands Manual BI-EMPTYARGS(1) + + + +NNAAMMEE + BI-emptyargs - empty arguments to font alternation macros + +DDEESSCCRRIIPPTTIIOONN + leading text + + bboolldd_i_t_a_l_i_c + bboolldd_i_t_a_l_i_c + + trailing text + + + +OpenBSD April 6, 2015 BI-EMPTYARGS(1) diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index ef2cfefc014..66a72c964c5 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_term.c,v 1.131 2015/04/06 14:58:53 schwarze Exp $ */ +/* $OpenBSD: man_term.c,v 1.132 2015/04/06 22:06:06 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -319,7 +319,10 @@ pre_alternate(DECL_ARGS) term_fontrepl(p, font[i]); if (savelit && NULL == nn->next) mt->fl |= MANT_LITERAL; - print_man_node(p, mt, nn, meta); + assert(nn->type == ROFFT_TEXT); + term_word(p, nn->string); + if (nn->flags & MAN_EOS) + p->flags |= TERMP_SENTENCE; if (nn->next) p->flags |= TERMP_NOSPACE; } |