implement ends with search r=alecf 30470

git-svn-id: svn://10.0.0.236/trunk@74825 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%netscape.com
2000-07-26 21:19:24 +00:00
parent a01c520564
commit 5d05aeabbe

View File

@@ -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: