]> diplodocus.org Git - nmh/blobdiff - sbr/m_draft.c
Renamed getmymbox mh-format escape function to getmyaddr, and
[nmh] / sbr / m_draft.c
index d3e988edd5925d4527b6b733f6e2949a6bf29a3c..de5ac5cc1bc18f112a5006345d688d37a225e71a 100644 (file)
@@ -2,8 +2,6 @@
 /*
  * m_draft.c -- construct the name of a draft message
  *
 /*
  * 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.
  * 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.
@@ -11,7 +9,6 @@
 
 #include <h/mh.h>
 #include <h/utils.h>
 
 #include <h/mh.h>
 #include <h/utils.h>
-#include <errno.h>
 
 
 char *
 
 
 char *
@@ -32,7 +29,9 @@ m_draft (char *folder, char *msg, int use, int *isdf)
     }
     *isdf = 1;
     
     }
     *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);
     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 (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);
 
     /*
        adios (NULL, "unable to read folder %s", folder);
 
     /*