emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot 92b0c5d 41/49: Fix #610: protect against empty UR


From: Stefan Monnier
Subject: [elpa] externals/eglot 92b0c5d 41/49: Fix #610: protect against empty URIs on windows
Date: Wed, 17 Mar 2021 18:41:50 -0400 (EDT)

branch: externals/eglot
commit 92b0c5d385cc6f3593f60c2f93917fd8b2d44207
Author: Theodor Thornhill <theo@thornhill.no>
Commit: GitHub <noreply@github.com>

    Fix #610: protect against empty URIs on windows
    
    Per #630.
    
    * eglot.el (eglot--uri-to-path): Check string length
    
    Co-authored-by: João Távora <joaotavora@gmail.com>
---
 eglot.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eglot.el b/eglot.el
index 017b820..0cb5839 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1176,7 +1176,8 @@ If optional MARKER, return a marker instead"
   "Convert URI to a file path."
   (when (keywordp uri) (setq uri (substring (symbol-name uri) 1)))
   (let ((retval (url-filename (url-generic-parse-url (url-unhex-string uri)))))
-    (if (eq system-type 'windows-nt) (substring retval 1) retval)))
+    (if (and (eq system-type 'windows-nt) (cl-plusp (length retval)))
+        (substring retval 1) retval)))
 
 (defun eglot--snippet-expansion-fn ()
   "Compute a function to expand snippets.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]