Skip to content

Commit

Permalink
Allow getting errors for invalid numeric version inputs.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@84989 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Aug 19, 2023
1 parent d8fa009 commit c3a18cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/library/base/R/version.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ 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_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_")))
stop(msg, domain = NA)
else
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() ...
Expand Down

0 comments on commit c3a18cc

Please sign in to comment.