Handle proper path normalization if we begin with '..'.
This commit is contained in:
parent
0b2bf227a8
commit
5e66f74f38
|
@ -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 == '..' then
|
if part == '..' and #accu > 0 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