summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2003-12-06 20:14:41 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2003-12-06 20:14:41 +0000
commitb153daa3b66f2b185e3c45a2d19ecda432f18baa (patch)
treeb1e71142b2a0ecf3625dd9aca8a0fc07c6facedd /usr.bin
parent9c478ff2b406908c5acc12a3bd31bf6818b7893e (diff)
Unbreak grepping for some patterns containing multiple dots. Fixes PR 3597.
ok deraadt@ millert@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/grep/util.c4
1 files changed, 2 insertions, 2 deletions
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 {