From owner-svn-src-all@FreeBSD.ORG Fri Jan 30 00:22:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 540011065673; Fri, 30 Jan 2009 00:22:08 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 417808FC18; Fri, 30 Jan 2009 00:22:08 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0U0M8oI069527; Fri, 30 Jan 2009 00:22:08 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0U0M8x7069526; Fri, 30 Jan 2009 00:22:08 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901300022.n0U0M8x7069526@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 30 Jan 2009 00:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187907 - head/gnu/usr.bin/grep X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2009 00:22:08 -0000 Author: obrien Date: Fri Jan 30 00:22:08 2009 New Revision: 187907 URL: http://svn.freebsd.org/changeset/base/187907 Log: 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 Modified: head/gnu/usr.bin/grep/savedir.c Modified: head/gnu/usr.bin/grep/savedir.c ============================================================================== --- head/gnu/usr.bin/grep/savedir.c Thu Jan 29 23:30:17 2009 (r187906) +++ head/gnu/usr.bin/grep/savedir.c Fri Jan 30 00:22:08 2009 (r187907) @@ -17,6 +17,9 @@ /* Written by David MacKenzie . */ +#include +__FBSDID("$FreeBSD$"); + #if HAVE_CONFIG_H # include #endif @@ -137,10 +140,10 @@ savedir (const char *dir, off_t name_siz && !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; }