mirror of https://gitlab.com/ita1024/waf.git
Handle .. within paths in gccdeps
The current code handles .. at the beginning of a path, but not within the path
This commit is contained in:
parent
e10398fcd3
commit
2424393afd
|
@ -126,11 +126,17 @@ def post_run(self):
|
|||
node = path_to_node(bld.root, x, cached_nodes)
|
||||
else:
|
||||
path = bld.bldnode
|
||||
# when calling find_resource, make sure the path does not begin by '..'
|
||||
# when calling find_resource, make sure the path does not contain '..'
|
||||
x = [k for k in Utils.split_path(x) if k and k != '.']
|
||||
while lst and x[0] == '..':
|
||||
x = x[1:]
|
||||
path = path.parent
|
||||
while '..' in x:
|
||||
idx = x.index('..')
|
||||
if idx == 0:
|
||||
x = x[1:]
|
||||
path = path.parent
|
||||
else:
|
||||
del x[idx]
|
||||
del x[idx-1]
|
||||
|
||||
node = path_to_node(path, x, cached_nodes)
|
||||
|
||||
if not node:
|
||||
|
|
Loading…
Reference in New Issue