aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-12-23 22:40:18 -0500
committerMichael Hirsch, Ph.D <10931741+scivision@users.noreply.github.com>2019-12-24 09:25:53 -0500
commite1dd310333aa9a028ec037389539dcd660888323 (patch)
treeb1f065fa161dade9e3510088c14f3b5f77974085 /mesonbuild/dependencies/base.py
parent77e0008a1fede82851fdf13438619cb62e61c297 (diff)
downloadmeson-e1dd310333aa9a028ec037389539dcd660888323.zip
meson-e1dd310333aa9a028ec037389539dcd660888323.tar.gz
meson-e1dd310333aa9a028ec037389539dcd660888323.tar.bz2
bugfix: check len before index
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r--mesonbuild/dependencies/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 60239de..f17b9f2 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -704,7 +704,7 @@ class PkgConfigDependency(ExternalDependency):
cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env)
return cache[(self.pkgbin, targs, fenv)]
- def _convert_mingw_paths(self, args):
+ def _convert_mingw_paths(self, args: List[str]) -> List[str]:
'''
Both MSVC and native Python on Windows cannot handle MinGW-esque /c/foo
paths so convert them to C:/foo. We cannot resolve other paths starting
@@ -727,7 +727,7 @@ class PkgConfigDependency(ExternalDependency):
elif arg.startswith('/'):
pargs = PurePath(arg).parts
tmpl = '{}:/{}'
- elif arg.startswith(('-L', '-I')) or arg[1] == ':':
+ elif arg.startswith(('-L', '-I')) or (len(arg) > 2 and arg[1] == ':'):
# clean out improper '\\ ' as comes from some Windows pkg-config files
arg = arg.replace('\\ ', ' ')
if len(pargs) > 1 and len(pargs[1]) == 1: