]>
diplodocus.org Git - nmh/blob - sbr/m_maildir.c
846268aca089b39bfb78dce92121f599cd978898
1 /* m_maildir.c -- get the path for the mail directory
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
16 static char mailfold
[BUFSIZ
];
21 static char *exmaildir (char *);
25 m_maildir (char *folder
)
29 if ((cp
= exmaildir (folder
))
30 && (ep
= cp
+ strlen (cp
) - 1) > cp
39 m_mailpath (char *folder
)
45 && !has_prefix(folder
, CWD
)
46 && strcmp (folder
, DOT
)
47 && strcmp (folder
, DOTDOT
)
48 && !has_prefix(folder
, PWD
)) {
49 strncpy (maildir
, mailfold
, sizeof(maildir
)); /* preserve... */
50 cp
= getcpy (m_maildir (folder
));
51 strncpy (mailfold
, maildir
, sizeof(mailfold
));
53 cp
= path (folder
, TFOLDER
);
61 exmaildir (char *folder
)
65 /* use current folder if none is specified */
67 folder
= getfolder(1);
70 && !has_prefix(folder
, CWD
)
71 && strcmp (folder
, DOT
)
72 && strcmp (folder
, DOTDOT
)
73 && !has_prefix(folder
, PWD
))) {
74 strncpy (mailfold
, folder
, sizeof(mailfold
));
79 if ((pp
= context_find ("path")) && *pp
) {
81 snprintf(cp
, sizeof mailfold
, "%s/", mypath
);
86 cp
= stpcpy(cp
, path("./", TFOLDER
));