9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 92.01.31.21.51.28; author jromine; state Exp;
28 @/* m_draft.c - construct the draft name */
30 static char ident[] = "@@(#)$Id: m_draft.c,v 1.1 1992/01/31 21:51:28 jromine Exp jromine $";
36 #include <sys/types.h>
43 char *m_draft (folder, msg, use, isdf)
44 register char *folder,
50 register struct msgs *mp;
52 static char buffer[BUFSIZ];
54 if (*isdf == NOTOK || folder == NULL || *folder == 0) {
55 if (*isdf == NOTOK || (cp = m_find ("Draft-Folder")) == NULL) {
57 return m_maildir (msg && *msg ? msg : draft);
60 folder = path (*cp == '+' || *cp == '@@' ? cp + 1 : cp,
61 *cp != '@@' ? TFOLDER : TSUBCWF);
65 (void) chdir (m_maildir (""));
66 (void) strcpy (buffer, m_maildir (folder));
67 if (stat (buffer, &st) == NOTOK) {
69 adios (buffer, "error on folder");
70 cp = concat ("Create folder \"", buffer, "\"? ", NULLCP);
74 if (!makedir (buffer))
75 adios (NULLCP, "unable to create folder %s", buffer);
78 if (chdir (buffer) == NOTOK)
79 adios (buffer, "unable to change directory to");
80 if (!(mp = m_gmsg (folder)))
81 adios (NULLCP, "unable to read folder %s", folder);
83 if ((mp = m_remsg (mp, 0, MAXFOLDER)) == NULL)
84 adios (NULLCP, "unable to allocate folder storage");
85 mp -> msgflags |= MHPATH;
87 if (!m_convert (mp, msg && *msg ? msg : use ? "cur" : "new"))
91 adios (NULLCP, "only one message draft at a time!");
93 (void) sprintf (buffer, "%s/%s", mp -> foldpath, m_name (mp -> lowsel));
96 m_setcur (mp, mp -> lowsel);
112 static char ident[] = "@@(#)$Id: m_getfld.c,v 1.9 1992/01/24 18:03:41 jromine Exp $";