summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-10-02 12:14:44 +0000
committerschwarze <schwarze@openbsd.org>2018-10-02 12:14:44 +0000
commiteb9ded0c4a3992333233370d6b726e4fe954d7d9 (patch)
treec3043c781ecad8c839266be55e4e92027d91a370
parentdocument that uuid_create generates v4 uuids; from william orr (diff)
downloadwireguard-openbsd-eb9ded0c4a3992333233370d6b726e4fe954d7d9.tar.xz
wireguard-openbsd-eb9ded0c4a3992333233370d6b726e4fe954d7d9.zip
Render the eqn(7) "sqrt" function as U+221A in UTF-8 output.
This also agrees with what groff does. Suggested by an attendee of EuroBSDCon 2018 in Bucuresti. Written on the plane Bucuresti-Frankfurt returning from EuroBSDCon.
-rw-r--r--regress/usr.bin/mandoc/eqn/over/precedence.out_ascii4
-rw-r--r--regress/usr.bin/mandoc/eqn/unary/sqrt.out_ascii4
-rw-r--r--usr.bin/mandoc/eqn_term.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/regress/usr.bin/mandoc/eqn/over/precedence.out_ascii b/regress/usr.bin/mandoc/eqn/over/precedence.out_ascii
index 0dc9e747a1f..2a7f61be948 100644
--- a/regress/usr.bin/mandoc/eqn/over/precedence.out_ascii
+++ b/regress/usr.bin/mandoc/eqn/over/precedence.out_ascii
@@ -4,7 +4,7 @@ NNAAMMEE
oovveerr--pprreecceeddeennccee - precedence of the fraction operator
DDEESSCCRRIIPPTTIIOONN
- initial text 1 + _x + (_x^2)/2 + (_x^3)/(2 * 3); _a^/_c~; aa/cc; sqrt(_a)/sqrt(_c)
- final text
+ initial text 1 + _x + (_x^2)/2 + (_x^3)/(2 * 3); _a^/_c~; aa/cc;
+ <sqrt>(_a)/<sqrt>(_c) final text
OpenBSD July 6, 2017 OpenBSD
diff --git a/regress/usr.bin/mandoc/eqn/unary/sqrt.out_ascii b/regress/usr.bin/mandoc/eqn/unary/sqrt.out_ascii
index 72b7047debc..c6d19d207da 100644
--- a/regress/usr.bin/mandoc/eqn/unary/sqrt.out_ascii
+++ b/regress/usr.bin/mandoc/eqn/unary/sqrt.out_ascii
@@ -4,7 +4,7 @@ NNAAMMEE
uunnaarryy--ssqqrrtt - square root
DDEESSCCRRIIPPTTIIOONN
- initial text _r = sqrt(_x^2 + _y^2) + sqrt(_a + _b) + sqrt(_x^) + sqrt() + sqrt
- final text
+ initial text _r = <sqrt>(_x^2 + _y^2) + <sqrt>(_a + _b) + <sqrt>(_x^) +
+ <sqrt>() + <sqrt> final text
OpenBSD July 6, 2017 OpenBSD
diff --git a/usr.bin/mandoc/eqn_term.c b/usr.bin/mandoc/eqn_term.c
index d272c405577..9cbd2a5f159 100644
--- a/usr.bin/mandoc/eqn_term.c
+++ b/usr.bin/mandoc/eqn_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eqn_term.c,v 1.13 2017/08/23 21:56:04 schwarze Exp $ */
+/* $OpenBSD: eqn_term.c,v 1.14 2018/10/02 12:14:44 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -104,7 +104,7 @@ eqn_box(struct termp *p, const struct eqn_box *bp)
/* Special box types. */
if (bp->pos == EQNPOS_SQRT) {
- term_word(p, "sqrt");
+ term_word(p, "\\(sr");
if (bp->first != NULL) {
p->flags |= TERMP_NOSPACE;
eqn_box(p, bp->first);