Fixed #4798 (Token::Match(tok, '&|*|%var%') behaves differently when parsed or compiled)

This commit is contained in:
Daniel Marjamäki 2013-05-15 13:22:25 +02:00
parent e1fd003e2d
commit b84547a312
1 changed files with 7 additions and 0 deletions

View File

@ -336,6 +336,13 @@ static int multiComparePercent(const Token *tok, const char * * haystack_p,
if (needle[0] == '|' && needle[1] == '|')
return 1;
*haystack_p = haystack = haystack + 6;
} else if (haystack[1] == 'v' && // "%var%"
haystack[2] == 'a' &&
haystack[3] == 'r' &&
haystack[4] == '%') {
if (tok->isName())
return 1;
*haystack_p = haystack = haystack + 5;
}
if (*haystack == '|')