diff --git a/token.cpp b/token.cpp index c5344e63c..958f73c9a 100644 --- a/token.cpp +++ b/token.cpp @@ -140,8 +140,8 @@ bool TOKEN::simpleMatch(const TOKEN *tok, const char pattern[]) const char *current, *next; current = pattern; - next = strchr(pattern, ' '); - if ( !next ) + next = strchr(pattern, ' '); + if ( !next ) next = pattern + strlen(pattern); while ( *current ) @@ -152,11 +152,11 @@ bool TOKEN::simpleMatch(const TOKEN *tok, const char pattern[]) return false; current = next; - if ( *next ) - { - next = strchr(++current, ' '); - if ( !next ) - next = current + strlen(current); + if ( *next ) + { + next = strchr(++current, ' '); + if ( !next ) + next = current + strlen(current); } tok = tok->next(); }