icate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VScmL1Z38z12ng for ; Mon, 29 Apr 2024 09:02:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 43T92g3D054381 for ; Mon, 29 Apr 2024 09:02:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 43T92g6Z054380 for bugs@FreeBSD.org; Mon, 29 Apr 2024 09:02:42 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 237873] Inconsistent behavior between the program and its man page bsdgrep(1) Date: Mon, 29 Apr 2024 09:02:42 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: msl0000023508@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237873 --- Comment #5 from WHR --- > It seems that the -p option does not work in bsdgrep By digging futher into the source code, it appears that bsdgrep(1) simply translates its 'LINK_SKIP' for '-p' into 'FTS_PHYSICAL' flag for fts_open(3= ); after that it didn't have any special handling for symbolic links. Thus for= any symbolic link found by fts_read(3) will be followed in function 'procfile'. It should have cases for 'FTS_SL' and 'FTS_SLNONE' to filter out symbolic l= inks in case of 'LINK_SKIP', in this 'switch': https://cgit.freebsd.org/src/tree/usr.bin/grep/util.c?id=3De116e040f3091eca= 914a06dcd0bdd9f1aea23add#n155 --=20 You are receiving this mail because: You are the assignee for the bug.=