]>
diplodocus.org Git - nmh/blob - sbr/m_maildir.c
3 * m_maildir.c -- get the path for the mail directory
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
18 static char mailfold
[BUFSIZ
];
23 static char *exmaildir (char *);
27 m_maildir (char *folder
)
31 if ((cp
= exmaildir (folder
))
32 && (ep
= cp
+ strlen (cp
) - 1) > cp
41 m_mailpath (char *folder
)
47 && !has_prefix(folder
, CWD
)
48 && strcmp (folder
, DOT
)
49 && strcmp (folder
, DOTDOT
)
50 && !has_prefix(folder
, PWD
)) {
51 strncpy (maildir
, mailfold
, sizeof(maildir
)); /* preserve... */
52 cp
= getcpy (m_maildir (folder
));
53 strncpy (mailfold
, maildir
, sizeof(mailfold
));
55 cp
= path (folder
, TFOLDER
);
63 exmaildir (char *folder
)
67 /* use current folder if none is specified */
69 folder
= getfolder(1);
72 && !has_prefix(folder
, CWD
)
73 && strcmp (folder
, DOT
)
74 && strcmp (folder
, DOTDOT
)
75 && !has_prefix(folder
, PWD
))) {
76 strncpy (mailfold
, folder
, sizeof(mailfold
));
81 if ((pp
= context_find ("path")) && *pp
) {
83 snprintf(cp
, sizeof mailfold
, "%s/", mypath
);
88 cp
= stpcpy(cp
, path("./", TFOLDER
));