If multiple '..' handle correctly.
This commit is contained in:
parent
5e66f74f38
commit
e2a7578553
|
@ -284,7 +284,7 @@ function common.normalize_path(filename)
|
||||||
local parts = split_on_slash(filename, PATHSEP)
|
local parts = split_on_slash(filename, PATHSEP)
|
||||||
local accu = {}
|
local accu = {}
|
||||||
for _, part in ipairs(parts) do
|
for _, part in ipairs(parts) do
|
||||||
if part == '..' and #accu > 0 then
|
if part == '..' and #accu > 0 and accu[#accu] ~= ".." then
|
||||||
table.remove(accu)
|
table.remove(accu)
|
||||||
elseif part ~= '.' then
|
elseif part ~= '.' then
|
||||||
table.insert(accu, part)
|
table.insert(accu, part)
|
||||||
|
|
Loading…
Reference in New Issue