1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-26 07:54:06 +02:00

b2/subst.c (prepare_re): recognize % in union pattern

This commit is contained in:
Werner Almesberger 2012-06-03 09:42:09 -03:00
parent fb7b2461a5
commit e93ff0e683

View File

@ -90,7 +90,8 @@ static char *prepare_re(const char *re, char *units)
case '(':
parens++;
if (re[1] == '#' && re[2]) {
if (!isalpha(re[2]) || re[3] != ')')
if ((!isalpha(re[2]) && re[2] != '%') ||
re[3] != ')')
yyerrorf("invalid (#unit) syntax");
units[parens-1] = re[2];
unit_expr(&res, &res_len, re[2]);