Encode urls more before using in browse-url

* lisp/net/browse-url.el (browse-url-default-windows-browser)
(browse-url-default-macosx-browser): Encode the URL before using
(in case it contains spaces) (bug#50435).
This commit is contained in:
Lars Ingebrigtsen 2021-09-07 17:46:52 +02:00
parent 8448782b40
commit 743a53343c

View file

@ -966,6 +966,7 @@ click but point is not changed."
"Invoke the MS-Windows system's default Web browser.
The optional NEW-WINDOW argument is not used."
(interactive (browse-url-interactive-arg "URL: "))
(setq url (browse-url-encode-url url))
(cond ((eq system-type 'ms-dos)
(if dos-windows-version
(shell-command (concat "start " (shell-quote-argument url)))
@ -995,6 +996,7 @@ The optional NEW-WINDOW argument is not used."
"Invoke the macOS system's default Web browser.
The optional NEW-WINDOW argument is not used."
(interactive (browse-url-interactive-arg "URL: "))
(setq url (browse-url-encode-url url))
(start-process (concat "open " url) nil "open" url))
(function-put 'browse-url-default-macosx-browser 'browse-url-browser-kind