Fixed source paths containing ..
This commit is contained in:
parent
eac0c654f8
commit
98e849508d
@ -43,13 +43,17 @@
|
||||
|
||||
-- add it if it doesn't exist already
|
||||
local name = path.getname(p)
|
||||
local child = tr.children[name]
|
||||
if not child then
|
||||
child = premake.tree.new(name)
|
||||
child.path = p
|
||||
premake.tree.insert(tr, child)
|
||||
if name ~= ".." then
|
||||
local child = tr.children[name]
|
||||
if not child then
|
||||
child = premake.tree.new(name)
|
||||
child.path = p
|
||||
premake.tree.insert(tr, child)
|
||||
end
|
||||
return child
|
||||
else
|
||||
return tr
|
||||
end
|
||||
return child
|
||||
end
|
||||
|
||||
|
||||
|
@ -67,6 +67,14 @@
|
||||
getresult())
|
||||
end
|
||||
|
||||
function T.tree.SkipsDotDots()
|
||||
tree.add(tr, "../MyProject/hello")
|
||||
test.isequal(""
|
||||
.. "MyProject"
|
||||
.. ".hello",
|
||||
getresult())
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests for tree.getlocalpath()
|
||||
|
Reference in New Issue
Block a user