aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-01-08 20:33:00 +0200
committerGitHub <noreply@github.com>2018-01-08 20:33:00 +0200
commitca2db0f482e17b89d1b05ad056e4815bac4ad95d (patch)
tree3ca7b6835a0f10f3970068e14509a00a3fe168c0
parent76be01664459523bf8d62c1b21e5184f6f469a74 (diff)
parent894ff1e62905abe03420bf510704e58a3b3f6e19 (diff)
downloadmeson-ca2db0f482e17b89d1b05ad056e4815bac4ad95d.zip
meson-ca2db0f482e17b89d1b05ad056e4815bac4ad95d.tar.gz
meson-ca2db0f482e17b89d1b05ad056e4815bac4ad95d.tar.bz2
Merge pull request #2890 from ximion/subproject_path_fix
Allow subproject dirs in subdirectories in the source tree again
-rw-r--r--mesonbuild/interpreter.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 29b4033..48b8d82 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1883,10 +1883,14 @@ to directly access options of other subprojects.''')
raise InvalidCode('Second call to project().')
if not self.is_subproject() and 'subproject_dir' in kwargs:
spdirname = kwargs['subproject_dir']
- if '/' in spdirname or '\\' in spdirname:
- raise InterpreterException('Subproject_dir must not contain a path segment.')
+ if not isinstance(spdirname, str):
+ raise InterpreterException('Subproject_dir must be a string')
+ if os.path.isabs(spdirname):
+ raise InterpreterException('Subproject_dir must not be an absolute path.')
if spdirname.startswith('.'):
raise InterpreterException('Subproject_dir must not begin with a period.')
+ if '..' in spdirname:
+ raise InterpreterException('Subproject_dir must not contain a ".." segment.')
self.subproject_dir = spdirname
if 'meson_version' in kwargs: