[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 7857cc1c54 2/2: Fix egregious thinko in eglot--ur
From: |
ELPA Syncer |
Subject: |
[elpa] externals/eglot 7857cc1c54 2/2: Fix egregious thinko in eglot--uri-to-path |
Date: |
Sun, 8 May 2022 20:57:29 -0400 (EDT) |
branch: externals/eglot
commit 7857cc1c54cd32af72248da6dad38f0b31914219
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Fix egregious thinko in eglot--uri-to-path
One shouldn't unhex the URI before parsing it. Just consider a
filename with a # character in it. The character is encoded as C%23,
after unhexing the file name becomes.
/tmp/C#/Program.cs
Now, parsing this as the URL will fail completely as the # mean
"anchor" in URLs.
* eglot.el (eglot--uri-to-path): Fix thinko.
---
eglot.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eglot.el b/eglot.el
index 3a33ad3ec2..3e3eb3c543 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1440,7 +1440,7 @@ If optional MARKER, return a marker instead"
(when (keywordp uri) (setq uri (substring (symbol-name uri) 1)))
(let* ((server (eglot-current-server))
(remote-prefix (and server (eglot--trampish-p server)))
- (retval (url-filename (url-generic-parse-url (url-unhex-string uri))))
+ (retval (url-unhex-string (url-filename (url-generic-parse-url uri))))
;; Remove the leading "/" for local MS Windows-style paths.
(normalized (if (and (not remote-prefix)
(eq system-type 'windows-nt)