diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-03-29 09:01:58 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-03-29 09:01:58 +0800 |
commit | 13b4f3fe75c3aa450125fe895b42f3b3154fff11 (patch) | |
tree | a7cdf5481b36e87c75dea08bb24511e31d22e5aa /mbbsd | |
parent | 4ea734c43e13d49206ec5233259978698613aa31 (diff) | |
download | pttbbs-13b4f3fe75c3aa450125fe895b42f3b3154fff11.tar pttbbs-13b4f3fe75c3aa450125fe895b42f3b3154fff11.tar.gz pttbbs-13b4f3fe75c3aa450125fe895b42f3b3154fff11.tar.bz2 pttbbs-13b4f3fe75c3aa450125fe895b42f3b3154fff11.tar.lz pttbbs-13b4f3fe75c3aa450125fe895b42f3b3154fff11.tar.xz pttbbs-13b4f3fe75c3aa450125fe895b42f3b3154fff11.tar.zst pttbbs-13b4f3fe75c3aa450125fe895b42f3b3154fff11.zip |
Fix bad assertion when deleting tagged mail in mailbox.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1622 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/mail.c | 4 | ||||
-rw-r--r-- | mbbsd/read.c | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 506de43a..85f4c142 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1445,10 +1445,14 @@ static onekey_t mail_comms[] = { int m_read() { + int back_bid; if (get_num_records(currmaildir, sizeof(fileheader_t))) { curredit = EDIT_MAIL; curredit &= ~EDIT_ITEM; + back_bid = currbid; + currbid = 0; i_read(RMAIL, currmaildir, mailtitle, maildoent, mail_comms, -1); + currbid = back_bid; curredit = 0; currutmp->mailalert = load_mailalert(cuser.userid); return 0; diff --git a/mbbsd/read.c b/mbbsd/read.c index eaff5ed8..8074c71b 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -162,16 +162,19 @@ int TagPruner(int bid) { boardheader_t *bp; - assert(bid>0); - bp = getbcache(bid); - if (strcmp(bp->brdname, "Security") == 0) - return DONOTHING; + assert(bid >= 0); /* bid == 0 means in mailbox */ + if (bid){ + bp = getbcache(bid); + if (strcmp(bp->brdname, "Security") == 0) + return DONOTHING; + } if (TagNum && ((currstat != READING) || (currmode & MODE_BOARD))) { if (tolower(getans("刪除所有標記[N]?")) != 'y') return FULLUPDATE; delete_range(currdirect, 0, 0); TagNum = 0; - setbtotal(bid); + if (bid) + setbtotal(bid); return NEWDIRECT; } return DONOTHING; |