Bug 3016050: {"../Dir/file1.c","../../Dir/file2.c"} breaks Xcode (Stephane)

This commit is contained in:
Jason Perkins 2010-10-20 19:52:32 -04:00
parent e52f458c6c
commit 6da5323224
3 changed files with 16 additions and 2 deletions

View File

@ -24,6 +24,7 @@
* Bug 3035545: The pattern { "./folder/*.c" } matches no files
* Bug 3034222: StaticLib projects ignore linkoptions
* Bug 3020382: GCC PCH not working
* Bug 3016050: {"../Dir/file1.c","../../Dir/file2.c"} breaks Xcode (Stephane)
-------

View File

@ -51,9 +51,12 @@
return parentnode
end
-- Create the child if necessary
-- Create the child if necessary. If two children with the same name appear
-- at the same level, make sure they have the same path to prevent conflicts
-- i.e. ../Common and ../../Common can both appear at the top of the tree
-- yet they have different paths (Bug #3016050)
local childnode = parentnode.children[childname]
if not childnode then
if not childnode or childnode.path ~= p then
childnode = tree.insert(parentnode, tree.new(childname))
childnode.path = p
end

View File

@ -68,6 +68,16 @@
tree.add(tr, "MyProject/../hello")
test.isequal("MyProject>hello", getresult())
end
function suite.AddsNodes_OnDifferentParentLevel()
tree.add(tr, "../Common")
tree.add(tr, "../../Common")
test.isequal(2, #tr.children)
test.isequal("Common", tr.children[1].name)
test.isequal("Common", tr.children[2].name)
test.isequal("../Common", tr.children[1].path)
test.isequal("../../Common", tr.children[2].path)
end
--