]> diplodocus.org Git - nmh/blobdiff - sbr/m_maildir.c
new.c: Order two return statements to match comment.
[nmh] / sbr / m_maildir.c
index fdb0f8d1cccc0044a36dcd45506b9153d2541207..daf84a7328ca4dde4b4f7eb141c5a461850da4ff 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * m_maildir.c -- get the path for the mail directory
+/* m_maildir.c -- get the path for the mail directory
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -8,6 +7,7 @@
 
 #include <h/mh.h>
 #include <h/utils.h>
+#include "m_maildir.h"
 
 #define        CWD     "./"
 #define        DOT     "."
@@ -22,6 +22,7 @@ static char mailfold[BUFSIZ];
 static char *exmaildir (char *);
 
 
+/* Returns static char[], never NULL. */
 char *
 m_maildir (char *folder)
 {
@@ -36,6 +37,7 @@ m_maildir (char *folder)
 }
 
 
+/* Return value must be free(3)'d. */
 char *
 m_mailpath (char *folder)
 {
@@ -58,6 +60,7 @@ m_mailpath (char *folder)
 }
 
 
+/* Returns static char[], never NULL. */
 static char *
 exmaildir (char *folder)
 {
@@ -84,7 +87,9 @@ exmaildir (char *folder)
        }
        cp = stpcpy(cp, pp);
     } else {
-       cp = stpcpy(cp, path("./", TFOLDER));
+        char *p = path("./", TFOLDER);
+       cp = stpcpy(cp, p);
+        free(p);
     }
     if (cp[-1] != '/')
        *cp++ = '/';