Skip to content

Commit efd49e7

Browse files
committed
Handle symlinked database files correctly
1 parent 4504336 commit efd49e7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3737
`$__fish_data_dir/functions/cd.fish`. This should minimize the chances of an
3838
infinite loop when aliasing `cd=z`.
3939
- Symlinks not getting added to the database when `$_ZO_RESOLVE_SYMLINKS=0`.
40+
- Handle symlinked database files correctly.
4041

4142
## [0.9.4] - 2024-02-21
4243

src/db/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ impl Database {
3333
pub fn open_dir(data_dir: impl AsRef<Path>) -> Result<Self> {
3434
let data_dir = data_dir.as_ref();
3535
let path = data_dir.join("db.zo");
36+
let path = fs::canonicalize(&path).unwrap_or(path);
3637

3738
match fs::read(&path) {
3839
Ok(bytes) => Self::try_new(path, bytes, |bytes| Self::deserialize(bytes), false),

0 commit comments

Comments
 (0)