diff options
author | 2015-01-23 14:19:52 +0000 | |
---|---|---|
committer | 2015-01-23 14:19:52 +0000 | |
commit | ba61527ce93a83666fa36565b4d03e860a2bdd36 (patch) | |
tree | 8f22b2184cbec9a520505a4d7e312b14418169a2 /usr.bin/mandoc/mdoc_man.c | |
parent | typo (diff) | |
download | wireguard-openbsd-ba61527ce93a83666fa36565b4d03e860a2bdd36.tar.xz wireguard-openbsd-ba61527ce93a83666fa36565b4d03e860a2bdd36.zip |
Let .Aq/.Ao/.Ac print "<>" instead of the normal "\(la\(ra"
when the only child is .Mt, not when the preceding node is .An,
to improve robustness. Triggered by a question from Svyatoslav
Mishyn <juef at openmailbox dot org> (Crux Linux).
Diffstat (limited to 'usr.bin/mandoc/mdoc_man.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_man.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c index 5f420e580b1..2c6c966efe0 100644 --- a/usr.bin/mandoc/mdoc_man.c +++ b/usr.bin/mandoc/mdoc_man.c @@ -1,6 +1,6 @@ -/* $OpenBSD: mdoc_man.c,v 1.79 2014/12/24 23:31:59 schwarze Exp $ */ +/* $OpenBSD: mdoc_man.c,v 1.80 2015/01/23 14:19:52 schwarze Exp $ */ /* - * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2011-2015 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 @@ -877,8 +877,8 @@ static int pre_aq(DECL_ARGS) { - print_word(n->parent->prev != NULL && - n->parent->prev->tok == MDOC_An ? "<" : "\\(la"); + print_word(n->nchild == 1 && + n->child->tok == MDOC_Mt ? "<" : "\\(la"); outflags &= ~MMAN_spc; return(1); } @@ -888,8 +888,8 @@ post_aq(DECL_ARGS) { outflags &= ~(MMAN_spc | MMAN_nl); - print_word(n->parent->prev != NULL && - n->parent->prev->tok == MDOC_An ? ">" : "\\(ra"); + print_word(n->nchild == 1 && + n->child->tok == MDOC_Mt ? ">" : "\\(ra"); } static int |