grep: default REG_NOSUB

This commit is contained in:
Connor Lane Smith 2011-05-29 20:38:15 +01:00
parent 04bac53826
commit 6427386b02
1 changed files with 1 additions and 3 deletions

4
grep.c
View File

@ -18,7 +18,7 @@ int
main(int argc, char *argv[])
{
char c;
int flags = 0;
int flags = REG_NOSUB;
regex_t preg;
FILE *fp;
@ -43,8 +43,6 @@ main(int argc, char *argv[])
fprintf(stderr, "usage: %s [-cilnqv] pattern [files...]\n", argv[0]);
exit(2);
}
if(mode == 'c')
flags |= REG_NOSUB;
if(iflag)
flags |= REG_ICASE;
regcomp(&preg, argv[optind++], flags);