summaryrefslogtreecommitdiffstats
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-23 14:21:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-23 14:21:01 +0000
commit5cdc25331345b85829cb16411bb48b213b6ea7b1 (patch)
tree51bc59d705467014a8598b01b008c8261118c4e6 /mdoc_man.c
parent1c07d0670659745601b58f021984f85c38c41f44 (diff)
downloadmandoc-5cdc25331345b85829cb16411bb48b213b6ea7b1.tar.gz
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 'mdoc_man.c')
-rw-r--r--mdoc_man.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index bbf7c99b..e4d3126e 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,6 +1,6 @@
/* $Id$ */
/*
- * 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
@@ -879,8 +879,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);
}
@@ -890,8 +890,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