bugfix: check len before index

pull/4973/merge
Michael Hirsch, Ph.D 5 years ago committed by Michael Hirsch, Ph.D
parent 77e0008a1f
commit e1dd310333
  1. 4
      mesonbuild/dependencies/base.py

@ -704,7 +704,7 @@ class PkgConfigDependency(ExternalDependency):
cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env) cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env)
return cache[(self.pkgbin, targs, fenv)] 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 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 paths so convert them to C:/foo. We cannot resolve other paths starting
@ -727,7 +727,7 @@ class PkgConfigDependency(ExternalDependency):
elif arg.startswith('/'): elif arg.startswith('/'):
pargs = PurePath(arg).parts pargs = PurePath(arg).parts
tmpl = '{}:/{}' 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 # clean out improper '\\ ' as comes from some Windows pkg-config files
arg = arg.replace('\\ ', ' ') arg = arg.replace('\\ ', ' ')
if len(pargs) > 1 and len(pargs[1]) == 1: if len(pargs) > 1 and len(pargs[1]) == 1:

Loading…
Cancel
Save