mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-22 12:05:11 +00:00
Merge pull request #725 from kbravh/tz-variable-patch
Update determine_time_zone function to check TZ
This commit is contained in:
commit
8b852cb201
@ -1,4 +1,5 @@
|
||||
use std::cmp::max;
|
||||
use std::env;
|
||||
use std::fmt;
|
||||
use std::ops::Deref;
|
||||
use std::sync::{Mutex, MutexGuard};
|
||||
@ -291,7 +292,11 @@ impl Environment {
|
||||
}
|
||||
|
||||
fn determine_time_zone() -> TZResult<TimeZone> {
|
||||
TimeZone::from_file("/etc/localtime")
|
||||
if let Ok(file) = env::var("TZ") {
|
||||
TimeZone::from_file(format!("/usr/share/zoneinfo/{}", file))
|
||||
} else {
|
||||
TimeZone::from_file("/etc/localtime")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user