Closed Bug 11579 Opened 21 years ago Closed 21 years ago

nsMsgDatabase::HasNew() has broken use of NS_COMFALSE

Categories

(MailNews Core :: Database, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jband_mozilla, Assigned: sspitzer)

References

Details

nsMsgDatabase::HasNew() returns either NS_OK (0) or NS_COMFALSE (1).

nsMsgDatabase::GetFirstNew() checks for NS_SUCCEEDED(HasNew()) which is always
true even if m_newSet is NULL;

This will crash.

nsMsgDBFolder::ReadDBFolderInfo checks for '!db->HasNew()' which is either
broken or confusing.

NS_COMFALSE generally sucks.
Target Milestone: M10
setting M10
Blocks: 8929
fixed checked in.

HasNew() has been rewritten.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: M10 → M9
jband will have to verify, as it is in the source.
marking m9 and fixed.
Seth,

Was the old usage of HasNew() in nsMsgDBFolder.cpp broken?

It used to say '!db->HasNew()' and now it says '!hasnew'. These look the
same, but this function used to return NS_OK (which equals zero) for 'yes' and
now returns PR_TRUE for 'yes'. So either it was broken before, or it seems to
me, this change breaks it.

Just want to be sure.

John.
putterman has reviewed my code, and also believes it to be correct.

jband, thanks for the heads up.
Scott and Seth, please advise QA how to verify this bug.  If you believe this
cannot be verified by QA, please let me know.  I'll take your words and mark
Verified.
Thanks,
Fenella
Status: RESOLVED → VERIFIED
marking verified for fenella.

HasNew() no longer uses NS_COMFALSE

See:
http://lxr.mozilla.org/seamonkey/source/mailnews/db/msgdb/src/nsMsgDatabase.cpp#1538
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.