From 8c3bbba8241a0ae8804aa9d788f1475ab99e6080 Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Mon, 19 Mar 2012 00:45:01 +0000 Subject: [PATCH] rm[0].rm_so must be zero (an explicit check is made for zero in the outer if condition) Reviewed by: se Approved by: cperciva --- bin/expr/expr.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/expr/expr.y b/bin/expr/expr.y index 89f8cced337c..30704ed2818a 100644 --- a/bin/expr/expr.y +++ b/bin/expr/expr.y @@ -540,7 +540,7 @@ op_colon(struct val *a, struct val *b) v = make_str(a->u.s + rm[1].rm_so); } else - v = make_integer((intmax_t)(rm[0].rm_eo - rm[0].rm_so)); + v = make_integer((intmax_t)(rm[0].rm_eo)); else if (rp.re_nsub == 0) v = make_integer((intmax_t)0);