Handle symlinked database files correctly

This commit is contained in:
Ajeet D'Souza 2024-09-13 06:00:08 +05:30
parent 450433644f
commit efd49e7f3d
2 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`$__fish_data_dir/functions/cd.fish`. This should minimize the chances of an
infinite loop when aliasing `cd=z`.
- Symlinks not getting added to the database when `$_ZO_RESOLVE_SYMLINKS=0`.
- Handle symlinked database files correctly.
## [0.9.4] - 2024-02-21

View File

@ -33,6 +33,7 @@ impl Database {
pub fn open_dir(data_dir: impl AsRef<Path>) -> Result<Self> {
let data_dir = data_dir.as_ref();
let path = data_dir.join("db.zo");
let path = fs::canonicalize(&path).unwrap_or(path);
match fs::read(&path) {
Ok(bytes) => Self::try_new(path, bytes, |bytes| Self::deserialize(bytes), false),