mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: check relative path on expand_path (#165)
This commit is contained in:
parent
902c094224
commit
8e72ae90c1
2 changed files with 5 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use std::{cmp::Ordering, collections::BTreeMap, mem, ops::Deref};
|
||||
use std::{cmp::Ordering, collections::BTreeMap, mem};
|
||||
|
||||
use config::{manager::SortBy, MANAGER};
|
||||
use shared::Url;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@ pub fn expand_path(p: impl AsRef<Path>) -> PathBuf {
|
|||
return PathBuf::from_iter([&home, p.as_os_str()]);
|
||||
}
|
||||
}
|
||||
p.to_path_buf()
|
||||
if p.is_absolute() {
|
||||
return p.to_path_buf();
|
||||
}
|
||||
env::current_dir().map_or_else(|_| p.to_path_buf(), |c| c.join(p))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue