-.TH COND-NUMERIC 1 "April 7, 2014" OpenBSD
+.TH COND-NUMERIC 1 "December 16, 2014" OpenBSD
.SH NAME
cond-numeric \- roff conditions involving numbers
.SH DESCRIPTION
11
.ie 1:1 (t)
.el (f)
+.PP
+unmatched parenthesis:
+.ie (
+(t)
+.el (f)
+one
+.ie (1 (t)
+.el (f)
+.PP
+negated unmatched parenthesis:
+.ie !(
+(t)
+.el (f)
+zero
+.ie !(0 (t)
+.el (f)
operator ":": 00 (f) 01 (t) 10 (t) 11 (t)
+ unmatched parenthesis: (f) one (t)
+ negated unmatched parenthesis: (f) zero (t)
-OpenBSD April 7, 2014 COND-NUMERIC(1)
+
+
+OpenBSD December 16, 2014 COND-NUMERIC(1)
-/* $OpenBSD: roff.c,v 1.112 2014/12/15 23:42:31 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.113 2014/12/16 01:21:37 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
static int
roff_evalcond(struct roff *r, int ln, const char *v, int *pos)
{
- int wanttrue, number;
+ int number, savepos, wanttrue;
if ('!' == v[*pos]) {
wanttrue = 0;
break;
}
+ savepos = *pos;
if (roff_evalnum(r, ln, v, pos, &number, 0))
return((number > 0) == wanttrue);
- else
+ else if (*pos == savepos)
return(roff_evalstrcond(v, pos) == wanttrue);
+ else
+ return (0);
}
static enum rofferr