Skip to content

Commit

Permalink
[#928] Set TZDIR if empty (#936)
Browse files Browse the repository at this point in the history
* [#928] Call Sys.timezone() onLoad
  • Loading branch information
LeeMendelowitz committed Nov 21, 2020
1 parent 727a449 commit 6c535c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

## adapted from Syz.timezone and OlsonNames function
.find_tzdir <- function() {
## Initialize Sys.timezone() cache to avoid resetting TZDIR at a later stage.
## As of R4.0.3 Sys.timezone() intrusively sets TZDIR to non path values.
Sys.timezone()
if (.Platform$OS.type == "windows")
return(file.path(R.home("share"), "zoneinfo"))
tzdirs <- c("/usr/share/zoneinfo",
Expand All @@ -27,6 +24,9 @@
else NULL
}

## Initialize Sys.timezone() cache to avoid resetting TZDIR at a later stage.
## As of R4.0.3 Sys.timezone() intrusively sets TZDIR to non path values.
Sys.timezone()
tzdir <- Sys.getenv("TZDIR")
if (tzdir == "internal") {
Sys.setenv(TZDIR = file.path(R.home("share"), "zoneinfo"))
Expand Down

0 comments on commit 6c535c8

Please sign in to comment.