Skip to content

Commit

Permalink
grepl(..., code) may return a logical vector of length > 1, which wil…
Browse files Browse the repository at this point in the history
…l fail in r-devel when _R_CHECK_LENGTH_1_CONDITION_=true
  • Loading branch information
yihui committed Dec 10, 2018
1 parent 7f36b39 commit 0d9f1c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/block.R
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ process_tangle.block = function(x) {
paste(unlist(cmds), collapse = '\n')
} else knit_code$get(label)
# read external code if exists
if (!isFALSE(ev) && length(code) && grepl('read_chunk\\(.+\\)', code)) {
if (!isFALSE(ev) && length(code) && any(grepl('read_chunk\\(.+\\)', code))) {
eval(parse_only(unlist(stringr::str_extract_all(code, 'read_chunk\\(([^)]+)\\)'))))
}
code = parse_chunk(code)
Expand Down

0 comments on commit 0d9f1c4

Please sign in to comment.