From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 13 22:00:40 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 548EC16A4CE for ; Sun, 13 Feb 2005 22:00:40 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EFCE43D41 for ; Sun, 13 Feb 2005 22:00:40 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1DM0dCC065910 for ; Sun, 13 Feb 2005 22:00:39 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1DM0dBR065906; Sun, 13 Feb 2005 22:00:39 GMT (envelope-from gnats) Resent-Date: Sun, 13 Feb 2005 22:00:39 GMT Resent-Message-Id: <200502132200.j1DM0dBR065906@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andre Guibert de Bruet Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0654716A4CE for ; Sun, 13 Feb 2005 21:53:26 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id C05BB43D41 for ; Sun, 13 Feb 2005 21:53:25 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j1DLrPgO085971 for ; Sun, 13 Feb 2005 21:53:25 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j1DLrP5I085942; Sun, 13 Feb 2005 21:53:25 GMT (envelope-from nobody) Message-Id: <200502132153.j1DLrP5I085942@www.freebsd.org> Date: Sun, 13 Feb 2005 21:53:25 GMT From: Andre Guibert de Bruet To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: bin/77466: grep recursive directory loop reporting outputs extra newline in 6-CURRENT. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2005 22:00:40 -0000 >Number: 77466 >Category: bin >Synopsis: grep recursive directory loop reporting outputs extra newline in 6-CURRENT. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Feb 13 22:00:39 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Andre Guibert de Bruet >Release: 6.0-CURRENT >Organization: Silicon Landmark >Environment: FreeBSD bling.home 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Sat Feb 12 02:21:11 EST 2005 root@bling.home:/usr/CURRENT/sys/i386/compile/BLING i386 >Description: grep has built-in directory loop reporting that is enabled when using the -R (recursive) option. CURRENT (5.3 too?) outputs an extra newline character when such a directory loop is detected. This behavior is not found in FreeBSD 4.x. Additionally, it breaks scripts that depend upon the traditional behavior. >How-To-Repeat: $ grep -R somethingreallylongthatyouwillnotfind /usr/src grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/3dfx/@: recursive directory loop grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/aac/aac_linux/@: recursive directory loop grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/aac/@: recursive directory loop grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/accf_data/@: recursive directory loop grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/accf_http/@: recursive directory loop [snip] With the patch, you do not get the extra newline: $ grep -R somethingreallylongthatyouwillnotfind /usr/src grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/3dfx/@: recursive directory loop grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/aac/aac_linux/@: recursive directory loop grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/aac/@: recursive directory loop grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/accf_data/@: recursive directory loop grep: warning: /usr/src/sys/i386/compile/BLING/modules/usr/CURRENT/sys/modules/accf_http/@: recursive directory loop >Fix: I have a patch that addresses the issue. It is up at http://bling.properkernel.com/freebsd/grep.recursive.patch . >Release-Note: >Audit-Trail: >Unformatted: