head 1.6; access; symbols; locks; strict; comment @ * @; 1.6 date 92.12.15.00.20.22; author jromine; state Exp; branches; next 1.5; 1.5 date 92.01.31.21.54.56; author jromine; state Exp; branches; next 1.4; 1.4 date 90.04.05.15.31.56; author sources; state Exp; branches; next 1.3; 1.3 date 90.04.05.14.49.12; author sources; state Exp; branches; next 1.2; 1.2 date 90.02.06.13.08.59; author sources; state Exp; branches; next 1.1; 1.1 date 90.02.06.13.05.59; author sources; state Exp; branches; next ; desc @@ 1.6 log @endif sugar @ text @/* m_maildir.c - get the path for the mail directory */ #ifndef lint static char ident[] = "@@(#)$Id: m_maildir.c,v 1.5 1992/01/31 21:54:56 jromine Exp jromine $"; #endif /* lint */ #include "../h/mh.h" #include #define CWD "./" #define NCWD (sizeof CWD - 1) #define DOT "." #define DOTDOT ".." #define PWD "../" #define NPWD (sizeof PWD - 1) static char mailfold[BUFSIZ]; static char *exmaildir (); char *m_maildir (folder) register char *folder; { register char *cp, *ep; if ((cp = exmaildir (folder)) && (ep = cp + strlen (cp) - 1) > cp && *ep == '/') *ep = 0; return cp; } /* */ char *m_mailpath (folder) register char *folder; { register char *cp; char maildir[BUFSIZ]; if (*folder == '/' || strncmp (folder, CWD, NCWD) == 0 || strcmp (folder, DOT) == 0 || strcmp (folder, DOTDOT) == 0 || strncmp (folder, PWD, NPWD) == 0) cp = path (folder, TFOLDER); else { (void) strcpy (maildir, mailfold);/* preserve... */ cp = getcpy (m_maildir (folder)); (void) strcpy (mailfold, maildir); } return cp; } /* */ static char *exmaildir (folder) register char *folder; { register char *cp, *pp; if (folder == NULL) folder = m_getfolder (); if (*folder == '/' || strncmp (folder, CWD, NCWD) == 0 || strcmp (folder, DOT) == 0 || strcmp (folder, DOTDOT) == 0 || strncmp (folder, PWD, NPWD) == 0) { (void) strcpy (mailfold, folder); return mailfold; } cp = mailfold; if ((pp = m_find ("path")) != NULL && *pp) { if (*pp != '/') { (void) sprintf (cp, "%s/", mypath); cp += strlen (cp); } cp = copy (pp, cp); } else cp = copy (path ("./", TFOLDER), cp); if (cp[-1] != '/') *cp++ = '/'; (void) strcpy (cp, folder); return mailfold; } @ 1.5 log @kerberos @ text @d3 2 a4 2 static char ident[] = "@@(#)$Id: m_maildir.c,v 1.4 1990/04/05 15:31:56 sources Exp jromine $"; #endif lint @ 1.4 log @add ID @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id:$"; d31 1 a31 1 *ep = NULL; @ 1.3 log @add ID @ text @d3 1 a3 1 static char ident[] = "$Id:"; @ 1.2 log @ANSI Compilance @ text @d2 3 @ 1.1 log @Initial revision @ text @d16 1 a16 1 char *exmaildir (); @