From eb8b95176b771b323d0c62e22fd6e1615d135066 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Wed, 21 Jan 2026 09:09:02 +0800 Subject: [PATCH] fix(config): return normalized path in link mapping methods Previously, `map_path_to_link` and `map_link_to_path` returned the original input path when no mapping was found, instead of the normalized version. This could cause inconsistencies when paths with different representations (e.g., trailing slashes) were used. Now both methods consistently return the normalized path, ensuring uniform path handling throughout the application. --- py/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/config.py b/py/config.py index 548fcaef..8fdd5cb6 100644 --- a/py/config.py +++ b/py/config.py @@ -504,7 +504,7 @@ class Config: # If the path starts with the target path, replace with link path mapped_path = normalized_path.replace(target_path, link_path, 1) return mapped_path - return path + return normalized_path def map_link_to_path(self, link_path: str) -> str: """Map a symbolic link path back to the actual path""" @@ -519,7 +519,7 @@ class Config: # If the path starts with the link path, replace with actual path mapped_path = normalized_link.replace(link_path_mapped, target_path, 1) return mapped_path - return link_path + return normalized_link def _dedupe_existing_paths(self, raw_paths: Iterable[str]) -> Dict[str, str]: dedup: Dict[str, str] = {}