lib.Uri: Treat paths starting with ~" specially #48
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/fix/20260722-lib-uri-treat-paths-starting-with-specially"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
lib.Uri: Treat paths starting with "~" specially
An Uri instance constructed from "
~/some/path" returns "file://~/some/path" as the .full property, i.e. with the "~" in the authority part. That's not accurate and doesn't make the intended sense in an URL context, see RFC 8089:Common UNIX shells such as the Bourne-Again SHell (bash) and Z SHell (zsh) provide a function known as "tilde expansion" [Bash-Tilde] or "filename expansion" [Zsh-Tilde], where a path that begins with a tilde character "
~" can be expanded out to a special directory name. No such facility exists using the file URI scheme; a tilde in a file URI is always just a tilde.The "fix" introduced by this commit makes .full return the path without
file://prepended. That's conservative. It could also chose to expand the tilde, which is arguably cleaner. To be introduced by a later change after this commit has seen more coverage.