Skip to content

Commit

Permalink
Permit path separators in subdir names but with a warning. Closes #2794.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Feb 13, 2018
1 parent d0f6203 commit d26513d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mesonbuild/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1735,8 +1735,12 @@ def func_subproject(self, nodes, args, kwargs):
return self.do_subproject(dirname, kwargs)

def do_subproject(self, dirname, kwargs):
if '/' in dirname or '\\' in dirname:
raise InterpreterException('Subproject name must not contain a path separator.')
if '..' in dirname:
raise InterpreterException('Subproject name must not contain a ".." path segment.')
if os.path.isabs(dirname):
raise InterpreterException('Subproject name must not be an absolute path.')
if '\\' in dirname or '/' in dirname:
mlog.warning('Subproject name has a path separator. This may cause unexpected behaviour.')
if dirname in self.subproject_stack:
fullstack = self.subproject_stack + [dirname]
incpath = ' => '.join(fullstack)
Expand Down

0 comments on commit d26513d

Please sign in to comment.