X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a37e496eeca84e0ea3fc1c7a95b013541a443cee..73e1f01148bb9709a405e27f7d3c5a95ea03b859:/sbr/path.c diff --git a/sbr/path.c b/sbr/path.c index 28d0e773..a6568db8 100644 --- a/sbr/path.c +++ b/sbr/path.c @@ -5,8 +5,11 @@ * complete copyright information. */ -#include -#include +#include "h/mh.h" +#include "ssequal.h" +#include "getfolder.h" +#include "path.h" +#include "h/utils.h" #include "m_maildir.h" #define CWD "./" @@ -22,21 +25,22 @@ static char *pwds; static char *expath(char *,int); static void compath(char *); + +/* Return value must be free(3)'d. */ char * pluspath(char *name) { return path(name + 1, *name == '+' ? TFOLDER : TSUBCWF); } + +/* Return value must be free(3)'d. */ char * path(char *name, int flag) { char *p, *last; p = expath(name, flag); - if (!p) - return NULL; - last = p + strlen(p) - 1; if (last > p && *last == '/') *last = '\0'; @@ -45,6 +49,7 @@ path(char *name, int flag) } +/* Return value must be free(3)'d. */ static char * expath (char *name, int flag) {