From owner-freebsd-current@FreeBSD.ORG Fri Aug 12 14:23:41 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8C05106566C for ; Fri, 12 Aug 2011 14:23:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2C3638FC15 for ; Fri, 12 Aug 2011 14:23:40 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA03978 for ; Fri, 12 Aug 2011 17:23:38 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E45376A.2000409@FreeBSD.org> Date: Fri, 12 Aug 2011 17:23:38 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110705 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-current@FreeBSD.org References: <4E316D9C.6060007@FreeBSD.org> In-Reply-To: <4E316D9C.6060007@FreeBSD.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Re: oddities with fgrep X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 14:23:42 -0000 on 28/07/2011 17:09 Andriy Gapon said the following: > $ fgrep -w -r CS drm > ... > drm/include/drm/drm_mode.h:#define DRM_MODE_FLAG_NCSYNC (1<<8) > $ fgrep -w -r CSY drm > ... > drm/include/drm/drm_mode.h:#define DRM_MODE_FLAG_NCSYNC (1<<8) > $ fgrep -w -r CSYN drm > (exit 1) > $ fgrep -w -r NCS drm > (exit 1) > $ fgrep -w CS drm/include/drm/drm_mode.h > (exit 1) > > So looks like a potential bug in some optimization. > -w works correctly without -r. With -r it works correctly for some substrings, > but not for others. FWIW, bsdgrep doesn't seem to have this quirk. -- Andriy Gapon