Skip to content

Commit bfdfb13

Browse files
djcrami3l
authored andcommitted
Fix home_dir() and current_dir() regression
1 parent 79ba44c commit bfdfb13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/currentprocess.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,17 @@ impl Process {
130130
impl home::env::Env for Process {
131131
fn home_dir(&self) -> Option<PathBuf> {
132132
match self {
133-
Process::OSProcess(_) => self.var("HOME").ok().map(|v| v.into()),
133+
Process::OSProcess(_) => home::env::OS_ENV.home_dir(),
134134
#[cfg(feature = "test")]
135-
Process::TestProcess(_) => home::env::OS_ENV.home_dir(),
135+
Process::TestProcess(_) => self.var("HOME").ok().map(|v| v.into()),
136136
}
137137
}
138138

139139
fn current_dir(&self) -> Result<PathBuf, io::Error> {
140140
match self {
141-
Process::OSProcess(_) => self.current_dir(),
141+
Process::OSProcess(_) => home::env::OS_ENV.current_dir(),
142142
#[cfg(feature = "test")]
143-
Process::TestProcess(_) => home::env::OS_ENV.current_dir(),
143+
Process::TestProcess(_) => self.current_dir(),
144144
}
145145
}
146146

0 commit comments

Comments
 (0)