From: Lars Ingebrigtsen Date: Tue, 7 Sep 2021 15:46:52 +0000 (+0200) Subject: Encode urls more before using in browse-url X-Git-Tag: emacs-28.0.90~1120 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=743a53343c38fab5d1ff7f384b080def1ad2a2ef;p=emacs.git 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). --- diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index b8e1f1bf126..bf77ecc7af7 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -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