backend/ninja: use re.match instead of re.search

Since we've already determined that the first character is the start of
the expression anyway.
pull/13146/head
Dylan Baker 7 months ago
parent f603a266ec
commit 27dc1bcacb
  1. 2
      mesonbuild/backend/ninjabackend.py

@ -199,7 +199,7 @@ class NinjaRule:
# shell constructs shouldn't be shell quoted
return NinjaCommandArg(c, Quoting.notShell)
if c.startswith('$'):
varp = re.search(r'\$\{?(\w*)\}?', c)
varp = re.match(r'\$\{?(\w*)\}?', c)
assert varp is not None, 'for mypy'
var: str = varp.group(1)
if var not in raw_names:

Loading…
Cancel
Save