If we have a match any pattern also match against blank lines
This commit is contained in:
parent
f4d8ff9598
commit
b6a41b688b
2
grep.c
2
grep.c
@ -196,7 +196,7 @@ grep(FILE *fp, const char *str)
|
|||||||
buf[len - 1] = '\0';
|
buf[len - 1] = '\0';
|
||||||
SLIST_FOREACH(pnode, &phead, entry) {
|
SLIST_FOREACH(pnode, &phead, entry) {
|
||||||
if (!Fflag) {
|
if (!Fflag) {
|
||||||
if (regexec(&pnode->preg, buf, 0, NULL, 0) ^ vflag)
|
if (regexec(&pnode->preg, buf[0] == '\0' ? "\n" : buf, 0, NULL, 0) ^ vflag)
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
if (!xflag) {
|
if (!xflag) {
|
||||||
|
Loading…
Reference in New Issue
Block a user