X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_draft.c;h=427d2dbc83534ea2c70f6ba50e6829c6bb8305cc;hp=4d1feffbdf82597b6e52148594230b86b3f54f61;hb=0f56dec07e0eda5042276a5e65cb51ea95c23ff9;hpb=5bfae54a3c9f2be059454d04875ba66fcbf1e6d4 diff --git a/sbr/m_draft.c b/sbr/m_draft.c index 4d1feff..427d2db 100644 --- a/sbr/m_draft.c +++ b/sbr/m_draft.c @@ -12,34 +12,25 @@ /* -** `which' should either be "cur" to use the current draft -** or "new" to start with a new draft. +** `which' should either be the cur sequence to use the current draft +** or the beyond sequence to start with a new draft. */ char * m_draft(char *which) { - register char *cp; register struct msgs *mp; static char buffer[BUFSIZ]; char *folder; - cp = draftfolder; - folder = pluspath(cp); - - chdir(m_maildir("")); - strncpy(buffer, m_maildir(folder), sizeof(buffer)); - - create_folder(buffer, 0, done); - - if (chdir(buffer) == -1) - adios(buffer, "unable to change directory to"); - - if (!(mp = folder_read(folder))) + folder = getcpy(toabsdir(draftfolder)); + create_folder(folder, 0, done); + if (!(mp = folder_read(folder))) { adios(NULL, "unable to read folder %s", folder); + } /* ** Make sure we have enough message status space for all - ** the message numbers from 1 to "new", since we might + ** the message numbers from 1 to one beyond last, since we might ** select an empty slot. If we add more space at the ** end, go ahead and add 10 additional slots. */ @@ -51,11 +42,11 @@ m_draft(char *which) adios(NULL, "unable to allocate folder storage"); } - mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */ + mp->msgflags |= ALLOW_BEYOND; /* allow the beyond sequence */ /* ** The draft message name to return is defined by `which'. - ** Usually it is "cur" (for the current draft) or "new" + ** Usually it is seq_cur (for the current draft) or seq_beyond ** (to start a new draft). */ if (!m_convert(mp, which))