Skip to content

Commit 7d831a7

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent d21f973 commit 7d831a7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/ui/main_window.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3605,9 +3605,16 @@ def _save_to_file(self, path: str) -> bool:
36053605
def make_relative(p: str) -> str:
36063606
if not p:
36073607
return p
3608+
# If the path is already relative, leave it unchanged to avoid
3609+
# reinterpreting it against the current working directory.
3610+
if not os.path.isabs(p):
3611+
return p
36083612
try:
3609-
return os.path.relpath(p, os.path.dirname(path))
3613+
base_dir = os.path.abspath(os.path.dirname(path))
3614+
abs_p = os.path.abspath(p)
3615+
return os.path.relpath(abs_p, base_dir)
36103616
except ValueError:
3617+
# Fall back to the original path if relpath cannot be computed
36113618
return p
36123619

36133620
# Serialize clips

0 commit comments

Comments
 (0)