version 1.41, 2010/04/20 15:58:08 |
version 1.42, 2010/07/02 22:18:03 |
|
|
|
|
if (Eflag) |
if (Eflag) |
cflags |= REG_EXTENDED; |
cflags |= REG_EXTENDED; |
|
if (Fflag) |
|
cflags |= REG_NOSPEC; |
|
#ifdef SMALL |
|
/* Sorry, this won't work */ |
|
if (Fflag && wflag) |
|
errx(1, "Can't use small fgrep with -w"); |
|
#endif |
fg_pattern = grep_calloc(patterns, sizeof(*fg_pattern)); |
fg_pattern = grep_calloc(patterns, sizeof(*fg_pattern)); |
r_pattern = grep_calloc(patterns, sizeof(*r_pattern)); |
r_pattern = grep_calloc(patterns, sizeof(*r_pattern)); |
for (i = 0; i < patterns; ++i) { |
for (i = 0; i < patterns; ++i) { |
/* Check if cheating is allowed (always is for fgrep). */ |
/* Check if cheating is allowed (always is for fgrep). */ |
|
#ifndef SMALL |
if (Fflag) { |
if (Fflag) { |
fgrepcomp(&fg_pattern[i], pattern[i]); |
fgrepcomp(&fg_pattern[i], pattern[i]); |
} else { |
} else |
|
#endif |
|
{ |
if (fastcomp(&fg_pattern[i], pattern[i])) { |
if (fastcomp(&fg_pattern[i], pattern[i])) { |
/* Fall back to full regex library */ |
/* Fall back to full regex library */ |
c = regcomp(&r_pattern[i], pattern[i], cflags); |
c = regcomp(&r_pattern[i], pattern[i], cflags); |