mirror of
https://github.com/sxyazi/yazi.git
synced 2024-12-18 14:21:32 +03:00
fix: check relative path on expand_path
(#165)
This commit is contained in:
parent
902c094224
commit
8e72ae90c1
@ -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…
Reference in New Issue
Block a user