From c99dbe923d43e62f76aaa8e1319649d00916ade8 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 --- mailnews/base/search/src/nsMsgSearchTerm.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mailnews/base/search/src/nsMsgSearchTerm.cpp b/mailnews/base/search/src/nsMsgSearchTerm.cpp index 64aa57512074..8ab1bcdf1366 100644 --- a/mailnews/base/search/src/nsMsgSearchTerm.cpp +++ b/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: