From b153daa3b66f2b185e3c45a2d19ecda432f18baa Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Sat, 6 Dec 2003 20:14:41 +0000 Subject: Unbreak grepping for some patterns containing multiple dots. Fixes PR 3597. ok deraadt@ millert@ --- usr.bin/grep/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/grep') diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 8b58175a329..a2378abe306 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.18 2003/10/28 13:23:59 avsm Exp $ */ +/* $OpenBSD: util.c,v 1.19 2003/12/06 20:14:40 otto Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -292,7 +292,7 @@ fastcomp(fastgrep_t *fg, const char *pattern) } else if (fg->pattern[i] == '.') { hasDot = i; if (i < fg->patternLen / 2) { - if (firstHalfDot < -1) + if (firstHalfDot < 0) /* Closest dot to the beginning */ firstHalfDot = i; } else { -- cgit v1.2.3