Date: Tue, 09 Aug 2011 16:43:47 +0400 From: Test Rat <ttsestt@gmail.com> To: freebsd-current@freebsd.org Cc: Gabor Kovesdan <gabor@freebsd.org> Subject: [bsdgrep] --exclude-dir doesn't work Message-ID: <86fwlaeovw.fsf@gmail.com>
next in thread | raw e-mail | index | archive | help
It seems fnmatch(3) args were accidentally swapped. Try
$ bsdgrep -Fr --exclude-dir '*.svn*' grep_ usr.bin/grep | bsdgrep -c svn
72
%%
Index: usr.bin/grep/util.c
===================================================================
--- usr.bin/grep/util.c (revision 224705)
+++ usr.bin/grep/util.c (working copy)
@@ -84,7 +84,7 @@ dir_matching(const char *dname)
for (unsigned int i = 0; i < dpatterns; ++i) {
if (dname != NULL &&
- fnmatch(dname, dpattern[i].pat, 0) == 0) {
+ fnmatch(dpattern[i].pat, dname, 0) == 0) {
if (dpattern[i].mode == EXCL_PAT)
return (false);
else
%%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86fwlaeovw.fsf>
