X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/bacae217c754a3eedd0d71bdda74397c17633123..7a5b7cbf34581a0294713ef5bb92ec5566b6be9f:/sbr/context_read.c diff --git a/sbr/context_read.c b/sbr/context_read.c index 778d4a35..f899624e 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -22,7 +22,11 @@ */ #include /* mh internals */ +#include "lock_file.h" +#include "m_maildir.h" +#include "makedir.h" #include /* structure for getpwuid() results */ +#include "h/utils.h" void context_read (void) @@ -36,7 +40,7 @@ context_read (void) int failed_to_lock = 0; /* - * If this routine _is_ called again (despite the wanings in the + * If this routine _is_ called again (despite the warnings in the * comments above), return immediately. */ if ( m_defs != 0 ) @@ -50,8 +54,7 @@ context_read (void) if ((mypath = getenv("HOME")) == NULL) { if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0') adios(NULL, "cannot determine your home directory"); - else - mypath = pw->pw_dir; + mypath = pw->pw_dir; } /* @@ -128,17 +131,17 @@ context_read (void) /* context is NULL if context_foil() was called to disable use of context * We also support users setting explicitly setting MHCONTEXT to /dev/null. - * (if this wasn't specialcased then the locking would be liable to fail) + * (if this wasn't special-cased then the locking would be liable to fail) */ if (!cp || (strcmp(cp,"/dev/null") == 0)) { ctxpath = NULL; return; } - ctxpath = getcpy (m_maildir (cp)); + ctxpath = mh_xstrdup(m_maildir(cp)); if ((ib = lkfopendata (ctxpath, "r", &failed_to_lock))) { - readconfig ((struct node **) 0, ib, cp, 1); + readconfig(NULL, ib, cp, 1); lkfclosedata (ib, ctxpath); } }