diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-06-24 18:45:31 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-06-24 18:45:31 +0000 |
commit | 1255ee5368c4c74e0f8254df0dc1d73d92c07dc4 (patch) | |
tree | 1fde5ca3a455142b2a8a08bc5e3ec79d7864cd6a /usr.bin/grep/util.c | |
parent | 0191546c78c851e2141ed446f323933bfc043999 (diff) |
actually do fgrep. -G -F and -E are now mutally exclusive, and override
the program name as expected. ok millert@
Diffstat (limited to 'usr.bin/grep/util.c')
-rw-r--r-- | usr.bin/grep/util.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 59bff4096d4..c6b887ce469 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.7 2003/06/24 17:32:10 tedu Exp $ */ +/* $OpenBSD: util.c,v 1.8 2003/06/24 18:45:30 tedu Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -246,6 +246,11 @@ fastcomp(fastgrep_t *fg, const char *pattern) int firstLastHalfDot = -1; int lastHalfDot = 0; + if (Fflag) { + fg->pattern = NULL; + return (-1); + } + /* Initialize. */ origPatternLen = fg->patternLen = strlen(pattern); fg->bol = 0; @@ -269,8 +274,8 @@ fastcomp(fastgrep_t *fg, const char *pattern) } /* - * Copy pattern minus '^' and '$' characters at the beginning and ending of - * the string respectively. + * Copy pattern minus '^' and '$' characters at the beginning and + * ending of the string respectively. */ fg->pattern = grep_strdup(pattern + bol); |