X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/31da9febde0d822d73f99089109bacc1c3e36433..ec173fd2c:/sbr/m_maildir.c?ds=sidebyside diff --git a/sbr/m_maildir.c b/sbr/m_maildir.c index c78b995a..5edc9360 100644 --- a/sbr/m_maildir.c +++ b/sbr/m_maildir.c @@ -5,8 +5,11 @@ * complete copyright information. */ -#include -#include +#include "h/mh.h" +#include "getfolder.h" +#include "context_find.h" +#include "path.h" +#include "h/utils.h" #include "m_maildir.h" #define CWD "./" @@ -22,6 +25,7 @@ static char mailfold[BUFSIZ]; static char *exmaildir (char *); +/* Returns static char[], never NULL. */ char * m_maildir (char *folder) { @@ -49,7 +53,7 @@ m_mailpath (char *folder) && strcmp (folder, DOTDOT) && !has_prefix(folder, PWD)) { strncpy (maildir, mailfold, sizeof(maildir)); /* preserve... */ - cp = getcpy (m_maildir (folder)); + cp = mh_xstrdup(m_maildir(folder)); strncpy (mailfold, maildir, sizeof(mailfold)); } else { cp = path (folder, TFOLDER); @@ -59,6 +63,7 @@ m_mailpath (char *folder) } +/* Returns static char[], never NULL. */ static char * exmaildir (char *folder) { @@ -85,7 +90,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++ = '/';