]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: Fix parsing file:// URIs on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Tue, 13 May 2025 11:45:04 +0000 (14:45 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 14 May 2025 12:35:06 +0000 (14:35 +0200)
* lisp/progmodes/eglot.el (eglot-uri-to-path): Remove the leading
slash in MS-Windows file names only if they begin with a slash.
This adjusts the function to the recent fix for bug#76982 in
'url-generic-parse-url', which previously would produce file names
that begin with an extra slash.  (Bug#78392)

(cherry picked from commit b3e280faba98d2ca7e4feef1017e3bebf53f036a)

lisp/progmodes/eglot.el

index 9a1f5cce4e683472beb8bcac413b88bb9da68c63..7447d8c71e59a3a9c5c1ba48ce7bbb61f830eb42 100644 (file)
@@ -1163,7 +1163,8 @@ object."
                ;; Remove the leading "/" for local MS Windows-style paths.
                (normalized (if (and (not remote-prefix)
                                     (eq system-type 'windows-nt)
-                                    (cl-plusp (length retval)))
+                                    (cl-plusp (length retval))
+                                    (eq (aref retval 0) ?/))
                                (w32-long-file-name (substring retval 1))
                              retval)))
           (concat remote-prefix normalized))