]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix report-emacs-bug via mailclient on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Thu, 3 May 2018 18:04:17 +0000 (21:04 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 3 May 2018 18:04:17 +0000 (21:04 +0300)
* lisp/net/browse-url.el (browse-url-default-windows-browser):
On MS-Windows, call url-unhex-string only for file:// URLs.
(Bug#31351)

lisp/net/browse-url.el

index 98b0acfc0c62c0599bdc154c6d76493220244352..a84a7b1c7162c25d56da907fe39d397d54343381 100644 (file)
@@ -878,7 +878,21 @@ The optional NEW-WINDOW argument is not used."
           (error "Browsing URLs is not supported on this system")))
        ((eq system-type 'cygwin)
         (call-process "cygstart" nil nil nil url))
-       (t (w32-shell-execute "open" (url-unhex-string url)))))
+       (t
+         (w32-shell-execute "open"
+                            ;; w32-shell-execute passes file:// URLs
+                            ;; to APIs that expect file names, so we
+                            ;; need to unhex any %nn encoded
+                            ;; characters in the URL.  We don't do
+                            ;; that for other URLs; in particular,
+                            ;; default Windows mail client barfs on
+                            ;; quotes in the MAILTO URLs, so we prefer
+                            ;; to leave the URL with its embedded %nn
+                            ;; encoding intact.
+                            (if (eq t (compare-strings url nil 7
+                                                       "file://" nil nil))
+                                (url-unhex-string url)
+                              url)))))
 
 (defun browse-url-default-macosx-browser (url &optional _new-window)
   "Invoke the macOS system's default Web browser.