Handle proper path normalization if we begin with '..'.

This commit is contained in:
Adam Harrison 2021-08-11 19:19:58 -04:00
parent 0b2bf227a8
commit 5e66f74f38
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ function common.normalize_path(filename)
local parts = split_on_slash(filename, PATHSEP)
local accu = {}
for _, part in ipairs(parts) do
if part == '..' then
if part == '..' and #accu > 0 then
table.remove(accu)
elseif part ~= '.' then
table.insert(accu, part)