[Bug 223524] whatis 'c++' fails with regex error

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Sep 9 09:05:46 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223524

Yuri Pankov <yuripv at yuripv.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yuripv at yuripv.net

--- Comment #1 from Yuri Pankov <yuripv at yuripv.net> ---
There are several problems here:
- by default, regcomp() is called with REG_EXTENDED, so '+' is a special
character and needs to be escaped
- once you quote '+', it becomes ordinary, but '+' is NOT a word character, so
matching fails

`whatis c+` (single plus) returns the same results as `whatis c`, as '+' means
"match 1 or more occurrences".

whatis could be changed to use REG_BASIC instead of REG_EXTENDED, but still,
"c++" is not a word, and won't match.

Given the above, this isn't really a bug as man page says "words" and not
"exact strings" :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list