Skip to content

Commit

Permalink
detect_c_compiler(): use shlex.split() instead of str.split() for env
Browse files Browse the repository at this point in the history
Use shlex.split() for splitting the env var instead of str.split() to
handle quoting and spaces in paths.
  • Loading branch information
fabio-porcedda committed Feb 17, 2017
1 parent 7144b03 commit 26e61ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mesonbuild/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from .compilers import *
from .mesonlib import EnvironmentException, Popen_safe
import configparser
import shlex
import shutil

build_filename = 'meson.build'
Expand Down Expand Up @@ -356,7 +357,7 @@ def detect_c_compiler(self, want_cross):
else:
exe_wrap = []
elif evar in os.environ:
compilers = os.environ[evar].split()
compilers = shlex.split(os.environ[evar])
ccache = []
is_cross = False
exe_wrap = None
Expand Down

0 comments on commit 26e61ee

Please sign in to comment.