X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/bc237bbae1393cacee9d534832a050f1148b0d8b..8eabc0badcbff3355d51bdc409bdbc262910d330:/sbr/m_maildir.c diff --git a/sbr/m_maildir.c b/sbr/m_maildir.c index 0e8d3f2c..daf84a73 100644 --- a/sbr/m_maildir.c +++ b/sbr/m_maildir.c @@ -1,6 +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 @@ -9,6 +7,7 @@ #include #include +#include "m_maildir.h" #define CWD "./" #define DOT "." @@ -23,6 +22,7 @@ static char mailfold[BUFSIZ]; static char *exmaildir (char *); +/* Returns static char[], never NULL. */ char * m_maildir (char *folder) { @@ -37,6 +37,7 @@ m_maildir (char *folder) } +/* Return value must be free(3)'d. */ char * m_mailpath (char *folder) { @@ -59,6 +60,7 @@ m_mailpath (char *folder) } +/* Returns static char[], never NULL. */ static char * exmaildir (char *folder) { @@ -85,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++ = '/';