diff options
author | obrien <obrien@FreeBSD.org> | 2009-01-30 00:22:08 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2009-01-30 00:22:08 +0000 |
commit | 6eaf14ce7957f8b1b374ed0f5301e6bb0bb43fe6 (patch) | |
tree | ae47009e372f78e44f8494b1f1e7ba0168cde121 /gnu | |
parent | 87de705ad7d516224a256133a494d65eb9229b60 (diff) | |
download | FreeBSD-src-6eaf14ce7957f8b1b374ed0f5301e6bb0bb43fe6.zip FreeBSD-src-6eaf14ce7957f8b1b374ed0f5301e6bb0bb43fe6.tar.gz |
For files not named on the command line, only the basename is compared
to the exclude pattern.
Change this so that "grep --exclude='*/.svn/*' -[Rr] foo *" DWIM.
Obtained from: dave+news001@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (Dave Gibson)
Obtained from: comp.unix.questions [Thu, 15 Mar 2007 18:54:38 +0000]
Obtained from: http://unix.derkeiler.com/Newsgroups/comp.unix.questions/2007-03/msg00046.html
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/grep/savedir.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gnu/usr.bin/grep/savedir.c b/gnu/usr.bin/grep/savedir.c index 9357cad..cfba77c 100644 --- a/gnu/usr.bin/grep/savedir.c +++ b/gnu/usr.bin/grep/savedir.c @@ -17,6 +17,9 @@ /* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #if HAVE_CONFIG_H # include <config.h> #endif @@ -137,10 +140,10 @@ savedir (const char *dir, off_t name_size, struct exclude *included_patterns, && !isdir1 (dir, dp->d_name)) { if (included_patterns - && !excluded_filename (included_patterns, dp->d_name, 0)) + && !excluded_filename (included_patterns, path, 0)) continue; if (excluded_patterns - && excluded_filename (excluded_patterns, dp->d_name, 0)) + && excluded_filename (excluded_patterns, path, 0)) continue; } |