From 2eb6f6bbb8ff74e47725a337d3eaab3f1ffa44f0 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 19 Nov 2014 01:20:25 +0000 Subject: 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@. --- roff.7 | 8 +++++--- roff.c | 4 +++- 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 .\" Copyright (c) 2010, 2011, 2013, 2014 Ingo Schwarze @@ -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 * Copyright (c) 2010-2014 Ingo Schwarze @@ -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: -- cgit v1.2.3-56-ge451