Regex used for configuration data substitution was too broad (#520)

pull/521/head
Nirbheek Chauhan 9 years ago committed by Jussi Pakkanen
parent 22f8824afb
commit 8cd359acbb
  1. 4
      mesonbuild/mesonlib.py

@ -252,7 +252,9 @@ def do_mesondefine(line, confdata):
def do_conf_file(src, dst, confdata): def do_conf_file(src, dst, confdata):
data = open(src).readlines() data = open(src).readlines()
regex = re.compile('@(.*?)@') # Only allow (a-z, A-Z, 0-9, _, -) as valid characters for a define
# Also allow escaping '@' with '\@'
regex = re.compile(r'[^\\]?@([-a-zA-Z0-9_]+)@')
result = [] result = []
for line in data: for line in data:
if line.startswith('#mesondefine'): if line.startswith('#mesondefine'):

Loading…
Cancel
Save