Bug 16376 - tools::codoc in src/library/tools/R/QC.R uses the wrong regular expression function
Summary: tools::codoc in src/library/tools/R/QC.R uses the wrong regular expression fu...
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Add-ons (show other bugs)
Version: R 3.2.0
Hardware: All All
: P5 major
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2015-05-10 13:07 UTC by Yixuan Qiu
Modified: 2017-04-07 00:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yixuan Qiu 2015-05-10 13:07:57 UTC
Lines 665~667 of src/library/tools/R/QC.R have the following code:

ind <- grep(.S4_method_markup_regexp, functions)
if(any(ind))
    functions <- functions[!ind]

The use of "any()" and "!ind" indicates that "ind" should be a logical vector. Hence grep() should be replaced by grepl().
Comment 1 Martin Maechler 2017-04-05 09:50:48 UTC
You are right.

It may be that this code is never really called .. which would be strange.
If it *has* been used in the past,  I do expect that _less_ functions are removed (from the list, in that code) and potentially new "codoc problems" should be found.

I'm committing a fix to R-devel only for now.
Comment 2 Yixuan Qiu 2017-04-07 00:21:14 UTC
Thank you Martin. I remember that I detected this problem because at that time `R CMD check` gave me warnings when I wrote a class that had a plus sign in the class name, and the Rd files were not properly recognized.