From 5d05aeabbeb365dfae6f0502f8202785bee77d3e Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Wed, 26 Jul 2000 21:19:24 +0000 Subject: [PATCH] implement ends with search r=alecf 30470 git-svn-id: svn://10.0.0.236/trunk@74825 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/search/src/nsMsgSearchTerm.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/mailnews/base/search/src/nsMsgSearchTerm.cpp b/mozilla/mailnews/base/search/src/nsMsgSearchTerm.cpp index 64aa5751207..8ab1bcdf136 100644 --- a/mozilla/mailnews/base/search/src/nsMsgSearchTerm.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgSearchTerm.cpp @@ -873,13 +873,22 @@ nsresult nsMsgSearchTerm::MatchString (const char *stringToMatch, #endif break; case nsMsgSearchOp::EndsWith: + { + PRUint32 searchStrLen = (PRUint32) PL_strlen(stringToMatch); + if (n_str.Length() <= searchStrLen) + { + PRInt32 sourceStrOffset = searchStrLen - n_str.Length(); + if (PL_strcmp(stringToMatch + sourceStrOffset, n_str) == 0) + result = PR_TRUE; + } + } #ifdef DO_I18N_YET { if((nsnull != n_str) && (nsnull != n_header) && INTL_StrEndWith(csid, n_header, n_str)) result = PR_TRUE; } #else - NS_ASSERTION(PR_FALSE, "not implemented yet"); + #endif break; default: