aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme/mail/mail.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-02-14 19:41:36 +0000
committerrsc <devnull@localhost>2006-02-14 19:41:36 +0000
commit3b5862ee5ab4452c8b5de2d062d713c843ee1e4f (patch)
treeb1efa4123ffba0745e80f7f29a0566498a9ffc19 /src/cmd/acme/mail/mail.c
parent0932b4841652fb8251100fceb4178f36bcde3131 (diff)
downloadplan9port-3b5862ee5ab4452c8b5de2d062d713c843ee1e4f.tar.gz
plan9port-3b5862ee5ab4452c8b5de2d062d713c843ee1e4f.tar.bz2
plan9port-3b5862ee5ab4452c8b5de2d062d713c843ee1e4f.zip
fixes
Diffstat (limited to 'src/cmd/acme/mail/mail.c')
-rw-r--r--src/cmd/acme/mail/mail.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/cmd/acme/mail/mail.c b/src/cmd/acme/mail/mail.c
index 83238598..ac74b634 100644
--- a/src/cmd/acme/mail/mail.c
+++ b/src/cmd/acme/mail/mail.c
@@ -60,12 +60,10 @@ removeupasfs(void)
int
ismaildir(char *s)
{
- char buf[256];
Dir *d;
int ret;
- snprint(buf, sizeof buf, "%s%s", maildir, s);
- d = dirstat(buf);
+ d = fsdirstat(mailfs, s);
if(d == nil)
return 0;
ret = d->qid.type & QTDIR;
@@ -122,9 +120,9 @@ threadmain(int argc, char *argv[])
if(argc>2 || i==0)
usage();
/* see if the name is that of an existing /mail/fs directory */
- if(argc==1 && strchr(argv[0], '/')==0 && ismaildir(argv[0])){
+ if(argc==1 && argv[0][0] != '/' && ismaildir(argv[0])){
name = argv[0];
- mboxname = eappend(estrdup(maildir), "", name);
+ mboxname = estrdup(name);
newdir = 0;
}else{
if(argv[0][i-1] == '/')
@@ -159,9 +157,9 @@ threadmain(int argc, char *argv[])
if(outgoing == nil)
outgoing = estrstrdup(mailboxdir, "/outgoing");
- mbox.ctlfd = fsopen(mailfs, "mbox/ctl", OWRITE);
+ mbox.ctlfd = fsopen(mailfs, estrstrdup(mboxname, "/ctl"), OWRITE);
if(mbox.ctlfd == nil)
- error("can't open %s: %r", "mbox/ctl");
+ error("can't open %s: %r", estrstrdup(mboxname, "/ctl"));
fsname = estrdup(name);
if(newdir && argc > 0){