aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-01-30 21:30:07 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-01-31 21:01:28 +0200
commitaf2067b6703d7ff55ea5978a822942e7152f4d05 (patch)
tree97f1e449303abe7e688ec6aa659183fac5effd02
parent64ed9656f04ec04f394b481041170e3f2cc38adc (diff)
downloadmeson-af2067b6703d7ff55ea5978a822942e7152f4d05.zip
meson-af2067b6703d7ff55ea5978a822942e7152f4d05.tar.gz
meson-af2067b6703d7ff55ea5978a822942e7152f4d05.tar.bz2
Make checks a bit more robust against empty entries.
-rw-r--r--mesonbuild/build.py4
-rw-r--r--mesonbuild/interpreter.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 98fd764..dc19b73 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1637,6 +1637,10 @@ class CustomTarget(Target):
for i in self.outputs:
if not(isinstance(i, str)):
raise InvalidArguments('Output argument not a string.')
+ if i == '':
+ raise InvalidArguments('Output must not be empty.')
+ if i.strip() == '':
+ raise InvalidArguments('Output must not consist only of whitespace.')
if '/' in i:
raise InvalidArguments('Output must not contain a path segment.')
if '@INPUT@' in i or '@INPUT0@' in i:
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index edcb92c..9c2fd00 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -3006,6 +3006,8 @@ different subdirectory.
def add_target(self, name, tobj):
if name == '':
raise InterpreterException('Target name must not be empty.')
+ if name.strip() == '':
+ raise InterpreterException('Target name must not consist only of whitespace.')
if name.startswith('meson-'):
raise InvalidArguments("Target names starting with 'meson-' are reserved "
"for Meson's internal use. Please rename.")