X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/4885712264980e6cbc2039f9158027bee9213475..eae69f175e0dc5229d74f1c3bf8fa42b6e69cd6f:/sbr/m_draft.c diff --git a/sbr/m_draft.c b/sbr/m_draft.c index 7aea6f01..e4791869 100644 --- a/sbr/m_draft.c +++ b/sbr/m_draft.c @@ -2,14 +2,13 @@ /* * m_draft.c -- construct the name of a draft message * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include +#include #include @@ -18,7 +17,6 @@ m_draft (char *folder, char *msg, int use, int *isdf) { register char *cp; register struct msgs *mp; - struct stat st; static char buffer[BUFSIZ]; if (*isdf == -1 || folder == NULL || *folder == '\0') { @@ -34,16 +32,8 @@ m_draft (char *folder, char *msg, int use, int *isdf) chdir (m_maildir ("")); strncpy (buffer, m_maildir (folder), sizeof(buffer)); - if (stat (buffer, &st) == -1) { - if (errno != ENOENT) - adios (buffer, "error on folder"); - cp = concat ("Create folder \"", buffer, "\"? ", NULL); - if (!getanswer (cp)) - done (0); - free (cp); - if (!makedir (buffer)) - adios (NULL, "unable to create folder %s", buffer); - } + + create_folder (buffer, 0, done); if (chdir (buffer) == -1) adios (buffer, "unable to change directory to");