Improvement: Add a way to get timezone from environment.
Firstly get timezone from environment. If not present, use file method
This commit is contained in:
parent
8e87e9d6eb
commit
badc57984e
@ -283,9 +283,16 @@ static BOOL winpr_match_unix_timezone_identifier_with_list(const char* tzid, con
|
||||
static TIME_ZONE_ENTRY* winpr_detect_windows_time_zone(void)
|
||||
{
|
||||
size_t i, j;
|
||||
char* tzid;
|
||||
char* tzid = NULL;
|
||||
|
||||
tzid = winpr_get_unix_timezone_identifier_from_file();
|
||||
char* tzenv = getenv("TZ");
|
||||
if (tzenv) {
|
||||
tzid = strdup(tzenv);
|
||||
}
|
||||
|
||||
if (tzid == NULL) {
|
||||
tzid = winpr_get_unix_timezone_identifier_from_file();
|
||||
}
|
||||
|
||||
if (tzid == NULL)
|
||||
tzid = winpr_get_timezone_from_link();
|
||||
|
Loading…
Reference in New Issue
Block a user