X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fcontext_read.c;h=cfdcff275c11192a2c753a68084452557d9fb8a9;hp=5886c5ee30109170dfa6105cc6a4d7ee78685da5;hb=ee8d01d64e8832304256de53db07228e2be67f6a;hpb=cf1205b5cbea2f0cd6ea710ec16c637df85b647c diff --git a/sbr/context_read.c b/sbr/context_read.c index 5886c5e..cfdcff2 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -25,6 +25,7 @@ */ #include /* mh internals */ +#include #include /* system call errors */ #include /* structure for getpwuid() results */ #include @@ -38,8 +39,8 @@ context_read(void) char *cp; /* miscellaneous pointer */ char *nd; /* nmh directory pointer */ struct stat st; /* stat() results */ - register struct passwd *pw; /* getpwuid() results */ - register FILE *ib; /* profile and context file pointer */ + struct passwd *pw; /* getpwuid() results */ + FILE *ib; /* profile and context file pointer */ /* ** If this routine _is_ called again (despite the wanings in the @@ -64,7 +65,7 @@ context_read(void) ** 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); } @@ -82,7 +83,7 @@ context_read(void) */ if ((cp = getenv("MMHP")) && *cp) { if (*cp == '/') { - defpath = getcpy(cp); + defpath = mh_xstrdup(cp); } else { defpath = concat(mmhpath, "/", cp, NULL); } @@ -126,7 +127,7 @@ context_read(void) 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"); } @@ -168,7 +169,7 @@ context_read(void) } if (*cp == '/') { - ctxpath = getcpy(cp); + ctxpath = mh_xstrdup(cp); } else { ctxpath = concat(mmhpath, "/", cp, NULL); }