31c31
< __FBSDID("$FreeBSD: head/usr.bin/grep/util.c 211496 2010-08-19 09:28:59Z des $");
---
> __FBSDID("$FreeBSD: head/usr.bin/grep/util.c 220421 2011-04-07 13:01:03Z gabor $");
57a58
> char *fname_base;
60a62
> fname_base = basename(fname);
63,65c65,66
< if (fnmatch(fpattern[i].pat,
< fname, 0) == 0 || fnmatch(fpattern[i].pat,
< basename(fname), 0) == 0) {
---
> if (fnmatch(fpattern[i].pat, fname, 0) == 0 ||
> fnmatch(fpattern[i].pat, fname_base, 0) == 0) {
280c281
< static inline int
---
> static int
321c322,323
< if (r == 0 && wflag && pmatch.rm_so != 0) {
---
> if (r == 0 && fg_pattern[i].word &&
> pmatch.rm_so != 0) {
< __FBSDID("$FreeBSD: head/usr.bin/grep/util.c 211496 2010-08-19 09:28:59Z des $");
---
> __FBSDID("$FreeBSD: head/usr.bin/grep/util.c 220421 2011-04-07 13:01:03Z gabor $");
57a58
> char *fname_base;
60a62
> fname_base = basename(fname);
63,65c65,66
< if (fnmatch(fpattern[i].pat,
< fname, 0) == 0 || fnmatch(fpattern[i].pat,
< basename(fname), 0) == 0) {
---
> if (fnmatch(fpattern[i].pat, fname, 0) == 0 ||
> fnmatch(fpattern[i].pat, fname_base, 0) == 0) {
280c281
< static inline int
---
> static int
321c322,323
< if (r == 0 && wflag && pmatch.rm_so != 0) {
---
> if (r == 0 && fg_pattern[i].word &&
> pmatch.rm_so != 0) {