Bug 237873 - Inconsistent behavior between the program and its man page bsdgrep(1)
Summary: Inconsistent behavior between the program and its man page bsdgrep(1)
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-05-13 09:29 UTC by WHR
Modified: 2019-06-07 11:49 UTC (History)
4 users (show)

See Also:


Attachments
bsdgrep-fix-manpage.diff (912 bytes, patch)
2019-05-13 09:31 UTC, WHR
no flags Details | Diff
bsdgrep-fix-program.diff (602 bytes, patch)
2019-05-13 09:31 UTC, WHR
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description WHR 2019-05-13 09:29:02 UTC
The man page bsdgrep(1) says the program won't follow any symbolic links when performing recursive search (with option '-r' or '-R').
But it follows! (try it!)

From the man page:

     -O      If -R is specified, follow symbolic links only if they were
             explicitly listed on the command line.  The default is not to
             follow symbolic links.

...

     -p      If -R is specified, no symbolic links are followed.  This is the
             default.

...

     -R, -r, --recursive
             Recursively search subdirectories listed.

     -S      If -R is specified, all symbolic links are followed.  The default
             is not to follow symbolic links.


This seems indicating that the option '-p' was the default, however the actual default was '-S', according to the source code (https://svnweb.freebsd.org/base/head/usr.bin/grep/grep.c?revision=334806&view=markup#l126).
Comment 1 WHR 2019-05-13 09:31:12 UTC
Created attachment 204352 [details]
bsdgrep-fix-manpage.diff
Comment 2 WHR 2019-05-13 09:31:39 UTC
Created attachment 204353 [details]
bsdgrep-fix-program.diff
Comment 3 WHR 2019-05-13 09:31:53 UTC
The attached 2 patches could fix the program or the man page.