aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-19 01:20:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-19 01:20:25 +0000
commit2eb6f6bbb8ff74e47725a337d3eaab3f1ffa44f0 (patch)
treeaf776295fc867ad15f73de11b68c415d8c36e10d
parentd0136da1bd32e7d85b9f64ac1a0cf2d00441d766 (diff)
downloadmandoc-2eb6f6bbb8ff74e47725a337d3eaab3f1ffa44f0.tar.gz
mandoc-2eb6f6bbb8ff74e47725a337d3eaab3f1ffa44f0.tar.zst
mandoc-2eb6f6bbb8ff74e47725a337d3eaab3f1ffa44f0.zip
Support the ".if v" conditional operator (vroff mode, always false)
for groff compatibility because pod2man(1) uses it that way. Weirdly, groff documents it as "for compatibility with other troff versions" but neither Heirloom nor Plan 9 have it. Issue reported by giovanni@ via sthen@.
-rw-r--r--roff.78
-rw-r--r--roff.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/roff.7 b/roff.7
index 6ac48a7e..6e2e8dd9 100644
--- a/roff.7
+++ b/roff.7
@@ -1,4 +1,4 @@
-.\" $Id: roff.7,v 1.58 2014/09/07 00:21:53 schwarze Exp $
+.\" $Id: roff.7,v 1.59 2014/11/19 01:20:25 schwarze Exp $
.\"
.\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010, 2011, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: September 7 2014 $
+.Dd $Mdocdate: November 19 2014 $
.Dt ROFF 7
.Os
.Sh NAME
@@ -747,9 +747,11 @@ If the first character of COND is
.Pq even page ,
.Sq r
.Pq register accessed ,
-or
.Sq t
.Pq troff mode ,
+or
+.Sq v
+.Pq vroff mode ,
COND evaluates to false.
.It
If COND starts with a parenthesis or with an optionally signed
diff --git a/roff.c b/roff.c
index f2ee39a3..f44f01f1 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.238 2014/11/01 06:03:13 schwarze Exp $ */
+/* $Id: roff.c,v 1.239 2014/11/19 01:20:25 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1272,6 +1272,8 @@ roff_evalcond(struct roff *r, int ln, const char *v, int *pos)
case 'r':
/* FALLTHROUGH */
case 't':
+ /* FALLTHROUGH */
+ case 'v':
(*pos)++;
return(!wanttrue);
default: