Closed Bug 436104 Opened 16 years ago Closed 16 years ago

Potentially erratic searching through address books

Categories

(MailNews Core :: Search, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Keywords: regression)

Attachments

(1 file)

Attached patch The fixSplinter Review
On bug 426317, Kent picked up the following:

While reviewing the address book search setup as part of preparing unit tests
for bug 187768, I saw some code I did not understand which I traced to this
patch.

Previously, in nsMsgSearchTerm::InitializeAddressBook there was this code:

    if (strcmp(dirURI.get(), m_value.string))
      mDirectory = nsnull; // clear out the directory....we are no longer
pointing to the right one


which has now been replaced by:

    if (uri.Equals(m_value.string))
      // clear out the directory....we are no longer pointing to the right one
      mDirectory = nsnull;

But the logic is backwards. strcmp returns 0 (false) when the string are equal.
So the new code should be:

    if (!uri.Equals(m_value.string))


I'm not quite sure of the effects, but I bet it would mess up some of our searching/filtering where we match in the address book. As this was in TB 3.0a1 I'm cc'ing QA people so they know about this potential problem.
Attachment #322774 - Flags: superreview?(bienvenu)
Attachment #322774 - Flags: review?(bienvenu)
Attachment #322774 - Flags: superreview?(bienvenu)
Attachment #322774 - Flags: superreview+
Attachment #322774 - Flags: review?(bienvenu)
Attachment #322774 - Flags: review+
Patch checked in, fixed.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: