1 /* m_maildir.c - get the path for the mail directory */
3 static char ident[] = "@(#)$Id: m_maildir.c,v 1.6 1992/12/15 00:20:22 jromine Exp $";
10 #define NCWD (sizeof CWD - 1)
14 #define NPWD (sizeof PWD - 1)
17 static char mailfold[BUFSIZ];
19 static char *exmaildir ();
22 char *m_maildir (folder)
23 register char *folder;
28 if ((cp = exmaildir (folder))
29 && (ep = cp + strlen (cp) - 1) > cp
38 char *m_mailpath (folder)
39 register char *folder;
45 || strncmp (folder, CWD, NCWD) == 0
46 || strcmp (folder, DOT) == 0
47 || strcmp (folder, DOTDOT) == 0
48 || strncmp (folder, PWD, NPWD) == 0)
49 cp = path (folder, TFOLDER);
51 (void) strcpy (maildir, mailfold);/* preserve... */
52 cp = getcpy (m_maildir (folder));
53 (void) strcpy (mailfold, maildir);
61 static char *exmaildir (folder)
62 register char *folder;
68 folder = m_getfolder ();
70 || strncmp (folder, CWD, NCWD) == 0
71 || strcmp (folder, DOT) == 0
72 || strcmp (folder, DOTDOT) == 0
73 || strncmp (folder, PWD, NPWD) == 0) {
74 (void) strcpy (mailfold, folder);
79 if ((pp = m_find ("path")) != NULL && *pp) {
81 (void) sprintf (cp, "%s/", mypath);
87 cp = copy (path ("./", TFOLDER), cp);
90 (void) strcpy (cp, folder);