grep: Change match any pattern to "^"
This commit is contained in:
parent
0e9eee4fa3
commit
0d955d3f23
2
grep.c
2
grep.c
|
@ -50,7 +50,7 @@ addpattern(const char *pattern, size_t patlen)
|
||||||
/* a null BRE/ERE matches every line */
|
/* a null BRE/ERE matches every line */
|
||||||
if (!Fflag)
|
if (!Fflag)
|
||||||
if (pattern[0] == '\0')
|
if (pattern[0] == '\0')
|
||||||
pattern = ".";
|
pattern = "^";
|
||||||
|
|
||||||
if (!Fflag && xflag) {
|
if (!Fflag && xflag) {
|
||||||
tmp = enmalloc(Error, patlen + 3);
|
tmp = enmalloc(Error, patlen + 3);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user