Skip to content

Commit 07cd9bc

Browse files
Jan200101jpakkane
authored andcommitted
handle empty curly braces correctly
in cmake variables are pure strings with no minimal required length so an empty string is a valid key and ${} needs to be handled accordingly.
1 parent 1fd839e commit 07cd9bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesonbuild/utils/universal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ def get_variable_regex(variable_format: Literal['meson', 'cmake', 'cmake@'] = 'm
14011401
| # OR
14021402
\\\${ # Match a backslash followed by a dollar sign and an opening curly brace
14031403
| # OR
1404-
\${(?P<cmake_variable>[-a-zA-Z0-9_]+)} # Match a variable enclosed in curly braces and capture the variable name
1404+
\${(?P<cmake_variable>[-a-zA-Z0-9_]*)} # Match a variable enclosed in curly braces and capture the variable name
14051405
| # OR
14061406
(?<!\\)@(?P<variable>[-a-zA-Z0-9_]+)@ # Match a variable enclosed in @ symbols and capture the variable name; no matches beginning with '\@'
14071407
| # OR

0 commit comments

Comments
 (0)