Skip to content
Snippets Groups Projects
Commit 7d7a4d74 authored by rswindell's avatar rswindell
Browse files

Bug-fix: MsgBase.remove_msg() was zeroing the to/from/subject (and other string

header fields).
parent 4d2fbc68
No related branches found
No related tags found
No related merge requests found
......@@ -1148,34 +1148,20 @@ js_remove_msg(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
if(!msg_specified)
return(JS_TRUE);
if((p->status=smb_getmsgidx(&(p->smb), &msg))!=SMB_SUCCESS)
return(JS_TRUE);
if((p->status=smb_lockmsghdr(&(p->smb),&msg))!=SMB_SUCCESS)
return(JS_TRUE);
do {
if((p->status=smb_getmsghdr(&(p->smb), &msg))!=SMB_SUCCESS)
break;
smb_freemsghdrmem(&msg); /* prevent duplicate header fields */
if((p->status=smb_getmsgidx(&(p->smb), &msg))==SMB_SUCCESS
&& (p->status=smb_getmsghdr(&(p->smb), &msg))==SMB_SUCCESS) {
msg.hdr.attr|=MSG_DELETE;
msg.idx.attr=msg.hdr.attr;
if((p->status=smb_putmsg(&(p->smb), &msg))!=SMB_SUCCESS)
break;
*rval = JSVAL_TRUE;
} while(0);
if((p->status=smb_updatemsg(&(p->smb), &msg))==SMB_SUCCESS)
*rval = JSVAL_TRUE;
}
smb_unlockmsghdr(&(p->smb),&msg);
smb_freemsgmem(&msg);
return(JS_TRUE);
}
static char* get_msg_text(private_t* p, smbmsg_t* msg, BOOL strip_ctrl_a, BOOL rfc822, ulong mode)
{
char* buf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment