diff --git a/lib/token.cpp b/lib/token.cpp index c04d8e2d4..9727cc283 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -555,11 +555,14 @@ int Token::multiCompare(const Token *tok, const char *haystack, nonneg int varid do { ++haystack; - } while (*haystack != ' ' && *haystack != '|' && *haystack); - if (*haystack == ' ' || *haystack == '\0') { - return -1; - } + if (*haystack == ' ' || *haystack == '\0') { + return -1; + } + if (*haystack == '|') { + break; + } + } while (true); ++haystack; }