X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_draft.c;h=050c7e51833643e83e2ae4a26e88d6bcecd594e5;hp=8492dd914e0dd5a46271ea34cde377e6f9efadb6;hb=a4ff68e851c0931ced437f73a1acb0fedb28bec3;hpb=3cc8ed080f6e741b8df04a3ebe764c659e75cb38 diff --git a/sbr/m_draft.c b/sbr/m_draft.c index 8492dd9..050c7e5 100644 --- a/sbr/m_draft.c +++ b/sbr/m_draft.c @@ -9,6 +9,7 @@ #include #include #include +#include /* @@ -18,15 +19,16 @@ char * m_draft(char *which) { - register struct msgs *mp; + struct msgs *mp; static char buffer[BUFSIZ]; char *folder; - folder = getcpy(toabsdir(draftfolder)); - create_folder(folder, 0, done); + folder = mh_xstrdup(toabsdir(draftfolder)); + create_folder(folder, 0, exit); if (!(mp = folder_read(folder))) { - adios(NULL, "unable to read folder %s", folder); + adios(EX_IOERR, NULL, "unable to read folder %s", folder); } + mh_free0(&folder); /* ** Make sure we have enough message status space for all @@ -36,13 +38,13 @@ m_draft(char *which) */ if (mp->hghmsg >= mp->hghoff) { if (!(mp = folder_realloc(mp, 1, mp->hghmsg + 10))) - adios(NULL, "unable to allocate folder storage"); + adios(EX_OSERR, NULL, "unable to allocate folder storage"); } else if (mp->lowoff > 1) { if (!(mp = folder_realloc(mp, 1, mp->hghoff))) - adios(NULL, "unable to allocate folder storage"); + adios(EX_OSERR, 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'. @@ -50,8 +52,7 @@ m_draft(char *which) ** (to start a new draft). */ if (!m_convert(mp, which)) - done(1); - seq_setprev(mp); + exit(EX_SOFTWARE); snprintf(buffer, sizeof(buffer), "%s/%s", mp->foldpath, m_name(mp->lowsel));