Summary: | space character in `man -K` option's regex | ||||||
---|---|---|---|---|---|---|---|
Product: | Documentation | Reporter: | Michael V <m.viey> | ||||
Component: | Manual Pages | Assignee: | Ed Maste <emaste> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | doc, emaste, freebsd | ||||
Priority: | --- | ||||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://reviews.freebsd.org/D41282 | ||||||
Attachments: |
|
Description
Michael V
2023-07-26 08:31:44 UTC
Created attachment 243625 [details]
quote the regexp argument
This rather seems to be a problem with quoting the regexp argument. We should also just quit after processing -K option (according to synopsis).
To be totally clear. I think there are 2 issues here: 1. The behavior of -K regex. This does work: man -K "BIOS\sextension" this doesn't: man -K "BIOS extension" 2. the fact that '\s' is not documented in man page and contradict re_format man page. (In reply to Yuri Pankov from comment #1) The only part needed should be: grep -E ${gflags} "${manfile}" -e "${re}" Spaces are preserved in variable assignment, e.g. in re=${1} Proposed change in https://reviews.freebsd.org/D41282 A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8a5c836b51ce29fb22e0692c03fbc1e405c6522f commit 8a5c836b51ce29fb22e0692c03fbc1e405c6522f Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2023-08-01 18:00:48 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2023-08-02 20:46:57 +0000 man: fix `man -K` search Quote re arg to grep in case it has spaces, and quote [:blank:] tr arg to avoid the shell interpreting []. PR: 272729 Reviewed by: Mina Galić <freebsd@igalic.co> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41282 usr.bin/man/man.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ^Triage: assign to committer and ask if possible interest in MFC. ^Triage: close due to lack of interest in MFC. |