*/
#include <h/mh.h> /* mh internals */
+#include <h/utils.h>
#include <errno.h> /* system call errors */
#include <pwd.h> /* structure for getpwuid() results */
#include <unistd.h>
** set mmhpath
*/
if ((cp = getenv("MMH")) && *cp) {
- mmhpath = getcpy(expanddir(cp)); /* rel to cwd */
+ mmhpath = mh_xstrdup(expanddir(cp)); /* rel to cwd */
if (stat(mmhpath, &st) != -1 && (st.st_mode & S_IFDIR) == 0) {
adios(EX_CONFIG, NULL, "`%s' specified by your MMH environment variable is not a directory", cp);
}
*/
if ((cp = getenv("MMHP")) && *cp) {
if (*cp == '/') {
- defpath = getcpy(cp);
+ defpath = mh_xstrdup(cp);
} else {
defpath = concat(mmhpath, "/", cp, NULL);
}
if (!getanswer(cp)) {
adios(EX_NOPERM, NULL, "Unable to access the mail storage directory `%s'", nd);
}
- free(cp);
+ mh_free0(&cp);
if (!makedir(nd)) {
adios(EX_CANTCREAT, nd, "unable to create");
}
}
if (*cp == '/') {
- ctxpath = getcpy(cp);
+ ctxpath = mh_xstrdup(cp);
} else {
ctxpath = concat(mmhpath, "/", cp, NULL);
}