summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-20 12:30:48 +0800
committersumneko <sumneko@hotmail.com>2019-05-20 12:30:48 +0800
commit88f00099a9b26fe4faafed58b990a789f5565eda (patch)
treec465a133f342d46de85790886455b1c4c68d28cc
parentc3a1a6c7e4e2f4d34d37a350aa12514fea77ad4c (diff)
downloadlua-language-server-88f00099a9b26fe4faafed58b990a789f5565eda.zip
用打过补丁的版本
-rw-r--r--server/src/3rd/lua-uri/uri/file/unix.lua2
-rw-r--r--server/src/3rd/lua-uri/uri/file/win32.lua10
2 files changed, 6 insertions, 6 deletions
diff --git a/server/src/3rd/lua-uri/uri/file/unix.lua b/server/src/3rd/lua-uri/uri/file/unix.lua
index 2ffe1504..8bd4c942 100644
--- a/server/src/3rd/lua-uri/uri/file/unix.lua
+++ b/server/src/3rd/lua-uri/uri/file/unix.lua
@@ -18,7 +18,7 @@ function M.make_file_uri (path)
error("Unix relative paths can't be converted to file URIs")
end
path = path:gsub("//+", "/")
- path = Util.uri_encode(path, "^A-Za-z0-9%-._~!$&'()*+,;=:@/")
+ path = Util.uri_encode(path, "^A-Za-z0-9%-._~!$&'()*+,;=@/")
return assert(URI:new("file://" .. path))
end
diff --git a/server/src/3rd/lua-uri/uri/file/win32.lua b/server/src/3rd/lua-uri/uri/file/win32.lua
index bdacbe15..d4e40243 100644
--- a/server/src/3rd/lua-uri/uri/file/win32.lua
+++ b/server/src/3rd/lua-uri/uri/file/win32.lua
@@ -19,13 +19,13 @@ function M.filesystem_path (uri)
end
function M.make_file_uri (path)
- if path:find("^[A-Za-z]:$") then path = path .. "\\" end
- local _, _, host, hostpath = path:find("^\\\\([A-Za-z.]+)\\(.*)$")
+ path = path:gsub("\\", "/")
+ if path:find("^[A-Za-z]:$") then path = path .. "/" end
+ local _, _, host, hostpath = path:find("^//([A-Za-z0-9.]+)/(.*)$")
host = host or ""
hostpath = hostpath or path
- hostpath = hostpath:gsub("\\", "/")
- :gsub("//+", "/")
- hostpath = Util.uri_encode(hostpath, "^A-Za-z0-9%-._~!$&'()*+,;=:@/")
+ hostpath = hostpath:gsub("//+", "/")
+ hostpath = Util.uri_encode(hostpath, "^A-Za-z0-9%-._~!$&'()*+,;=@/")
if not hostpath:find("^/") then hostpath = "/" .. hostpath end
return assert(URI:new("file://" .. host .. hostpath))
end