From 0bf5c27b64d650042d08ab4162307dce265c62bf Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Thu, 4 Jul 2019 22:05:42 +0200 Subject: [PATCH] env: Do not return empty tool env vars A compiler or other tool with an empty string as name does not make sense as it anyway can not be used and causes a failure later in parse_entry. Fix #5451 --- mesonbuild/envconfig.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index 03c6346a5..cec50599e 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -340,6 +340,10 @@ This is probably wrong, it should always point to the native compiler.''' % evar command = os.environ.get(evar) if command is not None: command = shlex.split(command) + + # Do not return empty string entries + if command is not None and len(command) == 0: + return None return command class Directories: