summaryrefslogtreecommitdiff
path: root/script/workspace
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-29 17:32:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-29 17:32:39 +0800
commitf4493d69bd682307d88599804723543bd25b17df (patch)
tree487cebbd5eec54494fed61b1d4a7053bff17bf08 /script/workspace
parentf78d4944b4d811956b6b1493b8a022f633babfdd (diff)
downloadlua-language-server-f4493d69bd682307d88599804723543bd25b17df.zip
fix #1405
Diffstat (limited to 'script/workspace')
-rw-r--r--script/workspace/workspace.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index e69a4be4..8ee7ad29 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -387,8 +387,11 @@ function m.normalize(path)
path = util.expandPath(path)
path = path:gsub('^%.[/\\]+', '')
for _ = 1, 1000 do
+ if path:sub(1, 2) == '..' then
+ break
+ end
local count
- path, count = path:gsub('[^/\\]+[/\\]%.%.', '')
+ path, count = path:gsub('[^/\\]+[/\\]+%.%.', '', 1)
if count == 0 then
break
end