aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.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
commit6a5d7b3417c42d71e00a671bdca73c0a15c8368a (patch)
tree9b7c1274e7d21b4f3f1980cec26430c236e6a6c9 /mdoc_term.c
parent5d66739b249d811455e368f2eb74af651ba8ffac (diff)
downloadmandoc-6a5d7b3417c42d71e00a671bdca73c0a15c8368a.tar.gz
mandoc-6a5d7b3417c42d71e00a671bdca73c0a15c8368a.tar.zst
mandoc-6a5d7b3417c42d71e00a671bdca73c0a15c8368a.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 'mdoc_term.c')
-rw-r--r--mdoc_term.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 6a392f64..a7058f8e 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,7 +1,7 @@
-/* $Id: mdoc_term.c,v 1.302 2014/12/24 23:32:42 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.303 2015/01/23 14:21:01 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -1855,8 +1855,8 @@ termp_quote_pre(DECL_ARGS)
case MDOC_Ao:
/* FALLTHROUGH */
case MDOC_Aq:
- term_word(p, n->parent->prev != NULL &&
- n->parent->prev->tok == MDOC_An ? "<" : "\\(la");
+ term_word(p, n->nchild == 1 &&
+ n->child->tok == MDOC_Mt ? "<" : "\\(la");
break;
case MDOC_Bro:
/* FALLTHROUGH */
@@ -1928,8 +1928,8 @@ termp_quote_post(DECL_ARGS)
case MDOC_Ao:
/* FALLTHROUGH */
case MDOC_Aq:
- term_word(p, n->parent->prev != NULL &&
- n->parent->prev->tok == MDOC_An ? ">" : "\\(ra");
+ term_word(p, n->nchild == 1 &&
+ n->child->tok == MDOC_Mt ? ">" : "\\(ra");
break;
case MDOC_Bro:
/* FALLTHROUGH */