Skip to content

Commit

Permalink
Tweaks for c84610.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@84703 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Jul 18, 2023
1 parent 5cabf8b commit 075a2c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/library/base/R/version.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,18 @@ function(x, strict = TRUE, regexp, classes = NULL)
if(!is.character(x)) {
msg <- gettextf("invalid non-character version specification 'x' (type: %s)",
typeof(x))
warning(msg, domain = NA, immediate. = TRUE)
if(nzchar(Sys.getenv("_R_CALLS_INVALID_NUMERIC_VERSION_"))) {
## Showing the call stack as part of warning() may truncate,
## so do it via message() ...
calls <- sys.calls()
msg <- paste0(msg, "\n",
gettext("Calls"), ":\n",
msg <- paste0(gettext("Calls"), ":\n",
paste0(sprintf("%2i: ", seq_along(calls)),
vapply(calls, deparse1, "",
collapse = "\n "),
collapse = "\n"))
message(msg, domain = NA)
}
warning(msg, domain = NA, immediate. = TRUE)
}
x <- as.character(x)
y <- rep.int(list(integer()), length(x))
Expand Down

0 comments on commit 075a2c6

Please sign in to comment.