X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/08aa8c17c3241bb5c6a997ed2e01e25a4d0089ce..dc4c3c4eeb3f74e5a7e3fedaded066572eac320b:/sbr/m_draft.c?ds=inline diff --git a/sbr/m_draft.c b/sbr/m_draft.c index b0168e2e..de5ac5cc 100644 --- a/sbr/m_draft.c +++ b/sbr/m_draft.c @@ -2,15 +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 char * @@ -18,7 +16,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') { @@ -32,7 +29,9 @@ m_draft (char *folder, char *msg, int use, int *isdf) } *isdf = 1; - chdir (m_maildir ("")); + if (chdir (m_maildir ("")) < 0) { + advise (m_maildir (""), "chdir"); + } strncpy (buffer, m_maildir (folder), sizeof(buffer)); create_folder (buffer, 0, done); @@ -40,7 +39,7 @@ m_draft (char *folder, char *msg, int use, int *isdf) if (chdir (buffer) == -1) adios (buffer, "unable to change directory to"); - if (!(mp = folder_read (folder))) + if (!(mp = folder_read (folder, 1))) adios (NULL, "unable to read folder %s", folder); /*