aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-10-13 09:52:44 +0200
committerLars Ingebrigtsen2022-10-13 09:52:51 +0200
commit4af4df18c54748eaac87be51660f3c80a415a82f (patch)
tree0e000a97150f274cff47f62c3af20e8d7852c477
parent7054481ed5ab588c308cb06a137bab24d777a1ab (diff)
downloademacs-4af4df18c54748eaac87be51660f3c80a415a82f.tar.gz
emacs-4af4df18c54748eaac87be51660f3c80a415a82f.zip
Fix browse-url-emacs for file: URLs on Windows
* lisp/net/browse-url.el (browse-url-emacs): Fix up file:///c:/foo/bar URLs on windows (bug#58464).
-rw-r--r--lisp/net/browse-url.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 2d528c4862c..1597f3651a5 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -1294,6 +1294,11 @@ currently selected window instead."
1294 (let ((file (url-unhex-string (url-filename parsed)))) 1294 (let ((file (url-unhex-string (url-filename parsed))))
1295 (when-let ((coding (browse-url--file-name-coding-system))) 1295 (when-let ((coding (browse-url--file-name-coding-system)))
1296 (setq file (decode-coding-string file 'utf-8))) 1296 (setq file (decode-coding-string file 'utf-8)))
1297 ;; The local-part of file: URLs on Windows is supposed to
1298 ;; start with an extra slash.
1299 (when (eq system-type 'windows-nt)
1300 (setq file (replace-regexp-in-string
1301 "\\`/\\([a-z]:\\)" "\\1" file)))
1297 (funcall func file)) 1302 (funcall func file))
1298 (let ((file-name-handler-alist 1303 (let ((file-name-handler-alist
1299 (cons (cons url-handler-regexp 'url-file-handler) 1304 (cons (cons url-handler-regexp 'url-file-handler)