Commit 1e62752a authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Restore ability for MsgBase.open() to open an arbitrary SMB msgbase

Before commit 5da26eca, you could pass Msgbase() the path to an SMB
on the disk and open() it, no configuration needed. As of 2 years
ago, I broke that, and passing a path to an SMB would open the "mail" base
instead - most unexpected. This is a feature of smb_open_sub() which we
switched to using (from smb_open()), so go back to using smb_open() when
an unrecognized code is pass to the constructor.

This has the negative consequence that the "mail" base can't be created
via JS. Probably should fix that.
parent 6b36b379
...@@ -93,7 +93,11 @@ js_open(JSContext *cx, uintN argc, jsval *arglist) ...@@ -93,7 +93,11 @@ js_open(JSContext *cx, uintN argc, jsval *arglist)
} }
rc=JS_SUSPENDREQUEST(cx); rc=JS_SUSPENDREQUEST(cx);
if((p->smb_result = smb_open_sub(scfg, &(p->smb), p->smb.subnum)) != SMB_SUCCESS) { if(p->smb.subnum == INVALID_SUB)
p->smb_result = smb_open(&(p->smb));
else
p->smb_result = smb_open_sub(scfg, &(p->smb), p->smb.subnum);
if(p->smb_result != SMB_SUCCESS) {
JS_RESUMEREQUEST(cx, rc); JS_RESUMEREQUEST(cx, rc);
return JS_TRUE; return JS_TRUE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment