From a4d4305919d2fcf2fd47dfb9b5a456a2059bf75e Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Thu, 4 Dec 2008 21:52:40 +0000 Subject: [PATCH] Bug fix: Minor bug in previous commit, test added to catch that bug also. --- testtokenize.cpp | 1 + token.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/testtokenize.cpp b/testtokenize.cpp index 12486588f..13c3f3b55 100644 --- a/testtokenize.cpp +++ b/testtokenize.cpp @@ -226,6 +226,7 @@ private: // Test for not found ASSERT_EQUALS( TOKEN::multiCompare( "one|two", "notfound" ), -1 ); ASSERT_EQUALS( TOKEN::multiCompare( "verybig|two", "s" ), -1 ); + ASSERT_EQUALS( TOKEN::multiCompare( "one|two", "ne" ), -1 ); } }; diff --git a/token.cpp b/token.cpp index 522b0cf49..6820ae1e2 100644 --- a/token.cpp +++ b/token.cpp @@ -105,6 +105,8 @@ int TOKEN::multiCompare( const char *needle, const char *haystack ) continue; } + else if( findNextOr ) + continue; // If this part of needle equals to the haystack else if( strncmp( haystack, needle, strlen( haystack ) ) == 0 )