Skip to content

fix(edit_uri): realpath page source path in root check#150

Open
El-cmd wants to merge 1 commit intobackstage:masterfrom
El-cmd:fix/macos-edit-uri-realpath
Open

fix(edit_uri): realpath page source path in root check#150
El-cmd wants to merge 1 commit intobackstage:masterfrom
El-cmd:fix/macos-edit-uri-realpath

Conversation

@El-cmd
Copy link
Copy Markdown

@El-cmd El-cmd commented Feb 18, 2026

On macOS, paths like /tmp and /var may resolve to /private/tmp and /private/var through symlinks.

EditUrl.__is_root() compared:

  • realpath(abs_root_config_docs_dir) (canonicalized)
  • self.page.file.abs_src_path (non-canonicalized)

This could produce false mismatches when one side includes /private and the other does not.

This PR canonicalizes both sides with path.realpath() before comparison.

Also added a minimal unit test to reproduce the macOS-style mismatch (/var/... vs /private/var/...) and validate the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant