Subject: bug#55357: 29.0.50; [PATCH] Fix browse-url-emacs on file:// urls

From: Eli Zaretskii <[email-masked]>
Date: Wed, 11 May 2022 14:37:17 +0300

> Resent-From: Yuan Fu <[email-masked]>
> Original-Sender: "Debbugs-submit" <[email-masked]>
> Resent-CC: [email-masked]
> Resent-Sender: [email-masked]
> From: Yuan Fu <[email-masked]>
> Date: Wed, 11 May 2022 00:05:50 -0700
> 
> 
> [1:text/plain Hide]
> 
> 
> If you call browse-url-emacs with a file:// url, Emacs does not open the correct file:
> 
> (browse-url-emacs "file://~/a/b") opens /a/b
> (browse-url-emacs "file://a/b") opens /b
> 
> Basically unless the path is an absolute path, the first level is chopped because url parses it as host and throws it away. This patch concats the host back. If the path is absolute, host is empty string so it’s ok.

I think your URLs lack one or two more slashes.  See

  https://en.wikipedia.org/wiki/File_URI_scheme#How_many_slashes?