X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a37e496eeca84e0ea3fc1c7a95b013541a443cee..84b0fcf3611555f616abf2dcc80ec30b18f16e29:/sbr/path.c diff --git a/sbr/path.c b/sbr/path.c index 28d0e773..d425dc8b 100644 --- a/sbr/path.c +++ b/sbr/path.c @@ -5,8 +5,9 @@ * complete copyright information. */ -#include -#include +#include "h/mh.h" +#include "path.h" +#include "h/utils.h" #include "m_maildir.h" #define CWD "./" @@ -22,21 +23,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 +47,7 @@ path(char *name, int flag) } +/* Return value must be free(3)'d. */ static char * expath (char *name, int flag) {